CrystalSpace

Public API Reference

CS::Animation::iSkeletonLookAtNodeFactory Struct Reference

Factory for the 'LookAt' animation node. More...

#include <imesh/animnode/lookat.h>

Inheritance diagram for CS::Animation::iSkeletonLookAtNodeFactory:

List of all members.

Public Member Functions

virtual iSkeletonAnimNodeFactoryGetChildNode () const =0
 Return the child animation node of this node.
virtual void GetDirection (csMatrix3 &direction) const =0
 Get the direction to look at, in bone space.
virtual void SetAlwaysRotate (bool alwaysRotate)=0
 Set whether or not the LookAt must still be kept even if the target is not reachable.
virtual void SetBodySkeleton (iBodySkeleton *skeleton)=0
 Set the body skeleton that is used to specify the rotational constraints of the animated bone.
virtual void SetBone (BoneID boneID)=0
 Set the bone animated by this node.
virtual void SetChildNode (iSkeletonAnimNodeFactory *node)=0
 Set the child animation node of this node.
virtual void SetDirection (const csMatrix3 &direction)=0
 Set the direction to look at, in bone space.
virtual void SetListenerDelay (float delay)=0
 Set how many time delay must be waited before the listeners are called with the 'target lost' event.
virtual void SetMaximumSpeed (float speed)=0
 Set the maximum rotation speed while trying to look at the target (in radian per second).

Detailed Description

Factory for the 'LookAt' animation node.

This node can control a bone of an animesh in order to make it look at a target. The direction to look at is defined by SetDirection().

There are three types of constraints that will modify the 'LookAt' control:

This animation node can manage by itself the transitions while changing the current 'LookAt' targets, therefore it doesn't need to be blended in and out.

This animation node uses only the pitch and yaw (ie rotations around X and Y axis) in order to achieve the look at the target, the roll is not used.

Definition at line 71 of file lookat.h.


Member Function Documentation

virtual iSkeletonAnimNodeFactory* CS::Animation::iSkeletonLookAtNodeFactory::GetChildNode (  )  const [pure virtual]

Return the child animation node of this node.

virtual void CS::Animation::iSkeletonLookAtNodeFactory::GetDirection ( csMatrix3 direction  )  const [pure virtual]

Get the direction to look at, in bone space.

virtual void CS::Animation::iSkeletonLookAtNodeFactory::SetAlwaysRotate ( bool  alwaysRotate  )  [pure virtual]

Set whether or not the LookAt must still be kept even if the target is not reachable.

The default value is 'false'.

virtual void CS::Animation::iSkeletonLookAtNodeFactory::SetBodySkeleton ( iBodySkeleton skeleton  )  [pure virtual]

Set the body skeleton that is used to specify the rotational constraints of the animated bone.

A CS::Animation::iBodyBone and a CS::Animation::iBodyBoneJoint must be defined for the bone animated by the 'LookAt' node. If skeleton is nullptr or if there is no CS::Animation::iBodyBoneJoint defined, then the animation won't have any rotational constraints.

The rotational constraints are specified relatively to the 'LookAt' direction defined through SetDirection().

virtual void CS::Animation::iSkeletonLookAtNodeFactory::SetBone ( BoneID  boneID  )  [pure virtual]

Set the bone animated by this node.

virtual void CS::Animation::iSkeletonLookAtNodeFactory::SetChildNode ( iSkeletonAnimNodeFactory node  )  [pure virtual]

Set the child animation node of this node.

The 'Lookat' animation node will add its control on top of the animation of the child node. The animation of the bone made by the child node may still be used, for example when the node is transitioning between targets, or when the target is not reachable.

It is valid to set a null reference as node.

virtual void CS::Animation::iSkeletonLookAtNodeFactory::SetDirection ( const csMatrix3 direction  )  [pure virtual]

Set the direction to look at, in bone space.

The Z axis should be aligned with the direction to look at, and the Y axis should be upward.

virtual void CS::Animation::iSkeletonLookAtNodeFactory::SetListenerDelay ( float  delay  )  [pure virtual]

Set how many time delay must be waited before the listeners are called with the 'target lost' event.

This can be useful if the maximum rotation speed of the bone is slow regarding the target's movement. In this case it may prevent swapping continuously between 'target reached' and 'target lost' events.

Parameters:
delay The time delay, in second. The default value is '0.1f'.
virtual void CS::Animation::iSkeletonLookAtNodeFactory::SetMaximumSpeed ( float  speed  )  [pure virtual]

Set the maximum rotation speed while trying to look at the target (in radian per second).

A speed of 0.0 means that the movement is immediate.

Parameters:
speed The maximum rotation speed, in radian per second. The default value is 'PI' (ie 3.1415).

The documentation for this struct was generated from the following file:

Generated for Crystal Space 2.1 by doxygen 1.6.1