Skip to content

Commit

Permalink
#152 obj.raycasted is ignored when an object is hidden and again vi…
Browse files Browse the repository at this point in the history
…sible
  • Loading branch information
jscastro76 committed Dec 21, 2020
1 parent a041fea commit 36d9de7
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ Minor version by [@jscastro76](https://github.com/jscastro76), some enhancements
- #111 Show the dimensions of a model
- #151 Remove auxiliary test method on CameraSync used to debug #145

#### :beetle: Bug fixes
- #152 `obj.raycasted` is ignored when an object is hidden and again visible

<br>

- - -
Expand Down
4 changes: 2 additions & 2 deletions dist/threebox.js
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ Threebox.prototype = {

programs: function () { return this.renderer.info.programs.length },

version: '2.1.5',
version: '2.1.6',

}

Expand Down Expand Up @@ -16648,7 +16648,7 @@ Objects.prototype = {
if (obj.model) {
obj.model.traverse(function (c) {
if (c.type == "Mesh" || c.type == "SkinnedMesh") {
if (_value) {
if (_value && obj.raycasted) {
c.layers.enable(0); //this makes the meshes visible for raycast
} else {
c.layers.disable(0); //this makes the meshes invisible for raycast
Expand Down
4 changes: 2 additions & 2 deletions dist/threebox.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Threebox.js
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ Threebox.prototype = {

programs: function () { return this.renderer.info.programs.length },

version: '2.1.5',
version: '2.1.6',

}

Expand Down
2 changes: 1 addition & 1 deletion src/objects/objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ Objects.prototype = {
if (obj.model) {
obj.model.traverse(function (c) {
if (c.type == "Mesh" || c.type == "SkinnedMesh") {
if (_value) {
if (_value && obj.raycasted) {
c.layers.enable(0); //this makes the meshes visible for raycast
} else {
c.layers.disable(0); //this makes the meshes invisible for raycast
Expand Down
4 changes: 2 additions & 2 deletions tests/threebox-tests-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -9925,7 +9925,7 @@ Threebox.prototype = {

programs: function () { return this.renderer.info.programs.length },

version: '2.1.5',
version: '2.1.6',

}

Expand Down Expand Up @@ -25586,7 +25586,7 @@ Objects.prototype = {
if (obj.model) {
obj.model.traverse(function (c) {
if (c.type == "Mesh" || c.type == "SkinnedMesh") {
if (_value) {
if (_value && obj.raycasted) {
c.layers.enable(0); //this makes the meshes visible for raycast
} else {
c.layers.disable(0); //this makes the meshes invisible for raycast
Expand Down

0 comments on commit 36d9de7

Please sign in to comment.