Skip to content

Commit

Permalink
* Fixed RTT materials not correctly set
Browse files Browse the repository at this point in the history
  • Loading branch information
QuirkyCort committed Oct 16, 2020
1 parent 8e49419 commit 5eaff67
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Documentation

Coding (Python editor)
- Documentation panel?
- Zoom in/out

Coding (Robot configurator)
- Help menu
Expand All @@ -36,6 +37,9 @@ Coding (Simulator)
- touch sensor (simplified laser rangefinder with very short range)
- Prevent jumping over wall when backing up. (Increasing wall friction doesn't work...)
- Set duty_cycle_sp. Useful for aligning to wall.
- Remote control
- Buttons
- Load zip file

Coding (Sharing)
- Remote coach view of student's work
Expand Down
7 changes: 6 additions & 1 deletion public/js/babylon.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ var babylon = new function() {

// RTT test
// var mat = new BABYLON.StandardMaterial("RTT mat", self.scene);
// mat.diffuseTexture = robot.getComponentByPort('in5').renderTarget;
// mat.diffuseTexture = robot.getComponentByPort('in1').renderTarget;
// mat.emissiveColor = new BABYLON.Color3(1,1,1);
// mat.disableLighting = true;

Expand All @@ -210,6 +210,9 @@ var babylon = new function() {
self.scene.meshes.forEach(function(mesh) {
mesh.origMaterial = mesh.material;
if (mesh.material == null) {
if (mesh.visibility) {
console.log('WARNING: ' + mesh.id + ' does not have a material');
}
mesh.rttMaterial == null;
} else {
let rttID = 'RTT_' + mesh.material.id;
Expand All @@ -224,6 +227,8 @@ var babylon = new function() {
mesh.rttMaterial.emissiveColor = mesh.rttMaterial.diffuseColor;
}
mesh.rttMaterial.freeze();
} else {
mesh.rttMaterial = mat;
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion public/js/world_Paintball.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ var world_Paintball = new function() {
this.loadFindTarget = function(scene) {
let ground = self.addCylinder(
scene,
null,
babylon.getMaterial(scene, 'fff'),
[10, 1000],
[0,0,-10]
);
Expand Down

0 comments on commit 5eaff67

Please sign in to comment.