For some reason when I'm trying to cast a ray using viewer.rayIntersect
it still hits transparent objects.
Looking at the rayIntersect
implementation it looks like _modelQueue.rayIntersect
ignores transparent objects while avp.VBIntersector.intersectObject
does not.
// ... rayIntersect implementation
var result = _modelQueue.rayIntersect(ray.origin, ray.direction, ignoreTransparent, dbIds, modelIds, intersections);
if (this.sceneAfter.children.length) {
var raycaster = new THREE.Raycaster(ray.origin, ray.direction, this.camera.near, this.camera.far);
var intersects = [];
avp.VBIntersector.intersectObject(this.sceneAfter, raycaster, intersects, true);
if (intersects.length) {
if (!result || intersects[0].distance < result.distance) {
result = intersects[0];
}
}
}
// ... rayIntersect implementation
Is there another way to cast a ray to get around this issue?
Edit:
Maybe it worth mentioning that the ray hits a Room Geometry (though invisible):
The blue dot is the ray intersection point, you can see it 'floats in the air' instead of being on the floor.
I'm using version 3.1