Compass Effect [Solved]


In the manual it says that you can use a compass effect to copy not just orientation, but also position or scale. Looking through the reference on NodePath however I couldn’t find either of the other options. Do they still exist? If so, how are they implemented?

In particular I am looking to apply a position compass for an artificial horizon (it happens to be a very convenient option). I have several work-arounds, so this isn’t critical, but would be nice.


Well that was almost completely unhelpful.

In the meantime I realized that I was looking at a convenience function only in Nodepath, and found the real reference page for CompassEffect.

For those who might search, here is how to implement an arbitrary compass effect:

object.setEffect(CompassEffect.make(node, reference))

Where the reference is a number depending on what effects you want apply. The reference numbers are such that to add multiple effects, use the bitwise or operator (|) between the numbers.

For numbers, see API reference: … Effect.php

Eg: A compass effect that applies rotation and x position:

object.setEffect(CompassEffect.make(node, CompassEffect.PRot | CompassEffect.PX))


object.setEffect(CompassEffect.make(node, 8 | 1))