Compass usage

Hey,

I was somewhat confused by the setCompass method of a NodePath. It led me to believe that the node will constantly look at the position of the target, not that the direction of the node is being fixed.
I need to draw an arrow pointing to a location in the world. Now I implemented a Runnable and call lookAt every frame. Is there a better method?

brew

The CompassEffect keeps the node constantly oriented in a particular direction, like a compass. You can create a BillboardEffect if you want the node to constantly look at a target. (The default target is the camera, but it can be set to any arbitrary node instead.)

You can’t use nodePath.setBillboard() for this advanced use of BillboardEffect. Instead, use:

nodePath.setEffect(BillboardEffect.make(Vec3(0, 0, 1), False, False, 0, target, Point3(0, 0, 0))

David

Perfect solution, thanks a lot!