Hello everyone,
I’m currently raycasting objects, which works perfectly for Meshes. But doesn’t work for URDFRobot objects.
URDFRobots are actually child classes from Object3D, therefore I assumed that it will also work for them but no success so far.
I use the urdf-loader - npm to load the URDF Objects, therefore I’m not sure if the threejs discourse forum is the right place to ask this question.
const intersects = this.raycaster.intersectObjects(this.scene.children);
if (intersects.length > 0) {
if (this.INTERSECTEDONCLICK.value != intersects[0].object) {
this.transformControls.detach()
this.INTERSECTEDONCLICK.next(intersects[0].object);
this.transformControls.attach(this.INTERSECTEDONCLICK.value)
}
}
I’m sure the URDFRobot is on the “this.scene.children” list. But so far no luck intersecting the URDFRobot.
any ideas?
I couldn’t create a fiddle I spend couple of hours creating a working jsfiddle, but did not succeed either, since I couldn’t use the URDFLoader from the external library using CDN.