Skip to main content

Candera 3D Listeners

Applications can receive notifications on scene graph events. Therefore implement and use a listener, which defines hooks to receive those notifications.

Following listener interfaces are provided in Candera 3D:

  • Candera::RendererListener defines hooks that are called before or after a node is rendered. It supports events for OnNodePreRender and OnNodePostRender, so you are informed before and after a node is rendered.
  • Candera::NodeListener defines hooks that are called when certain node functions are triggered, e.g. when a node's transformation changes.
  • Candera::SceneListener defines hooks that are called on certain scene actions. The listener informs when a scene is activated.
  • Candera::AnimationPlayerListener defines several hooks for the AnimationPlayer. It informs about changes of the animation, like when an animation has started, stopped, finished, resumed, paused and when the direction has changed.
  • Candera::CameraListener defines hooks that are called before or after a camera is rendered. It supports events for OnPreRender, OnPostRender, OnProjectionChanged and OnViewChanged.
  • Candera::ProjectionListener defines hooks that are called when projection parameters are changed. It supports OnProjectionChanged, which means the camera reacts to changes of the projection matrix associated and updates frustums accordingly.

In order to register a listener simply derive from the listener class and override pure virtual functions with custom code.

Example Listener Implementation

Refer to Using Animation Callback Functions for an example how to implement and use an Animation listener.