The HBhvBehaviorManager class stores and manages all animation related data. More...

#include <HBhvBehaviorManager.h>

Public Member Functions

void ActivateAllAnimations ()
 
void ActivateAnimationByName (const char *name, bool AllowPartial=true)
 
HBhvAnimationAddAnimation (const char *name, const char *target, HBhvTimeline *timeline, HBhvInterpolator *interpolator)
 
void AddAnimation (HBhvAnimation *animation)
 
HBhvAnimationAddAnimation (const char *name, const char *targetpath, HPoint *pivot)
 
void AddAttributeSwitchKeyframe (const char *animname, int tick, const char *att)
 
void AddAxisRotateKeyframe (const char *animname, int tick, float rot, HPoint *axis=0)
 
void AddColorKeyframe (const char *animname, int tick, HPoint color, const char *colorcomponent=0, const char *geomtype=0)
 
void AddColorMorphDataToAnimation (const char *animname, HPoint *md, int pnum, HBaseModel *model, int pos=-1)
 
void AddColorMorphInterpolator (const char *animname, int tick, const char *mident, bool discrete)
 
void AddInstanceCreateKeyframe (const char *animname, int tick, const char *instance)
 
void AddMatrixKeyframe (const char *animname, int tick, float matrix[])
 
void AddPositionKeyframe (const char *animname, int tick, HPoint pos, bool linear)
 
void AddQuatSquadKeyframe (const char *animname, int tick, HQuat rot, bool linear)
 
void AddScaleKeyframe (const char *animname, int tick, HPoint scale)
 
void AddSegmentMoveKeyframe (const char *animname, int tick, char *path)
 
void AddSegmentSwitchKeyframe (const char *animname, int tick, const char *ss)
 
void AddSensor (HBhvSensor *sensor)
 
void AddTargetObject (HBhvTargetObject *targetobject)
 
void AddTrailKeyframe (const char *animname, int tick, HPoint pos, bool linear, TrailInterpolatorType *trailtype=0, int *weight=0, const char *style=0, const char *color=0)
 
void AddVertexMorphDataToAnimation (const char *animname, HPoint *md, int pnum, HBaseModel *model, int pos=-1)
 
void AddVertexMorphInterpolator (const char *animname, int tick, const char *mident, bool discrete)
 
void CameraUpdated ()
 
void Continue ()
 
HBhvTargetObjectCreateTargetObjectByPath (const char *name, const char *path)
 
void DeactivateAllAnimations ()
 
void DeactivateAnimationByName (const char *name, bool AllowPartial=true)
 
void DeleteAllAnimations ()
 
void DeleteAnimation (HBhvAnimation *animation)
 
void ExecuteAnimations (float currenttick, float starttick)
 
HBhvAnimationFindAnimation (const char *target, const char *interpolatortype)
 
HBhvAnimationFindAnimationByName (const char *name)
 
HBhvSensorFindSensorByName (const char *name)
 
HBhvTargetObjectFindTargetObjectByName (const char *name)
 
HBhvTargetObjectFindTargetObjectByPath (const char *path)
 
HC_KEY GetActiveSceneKey ()
 
HBaseViewGetActiveView ()
 
vlist_s * GetAnimationList ()
 
bool GetCameraUpdated ()
 
bool GetContinuousPlay ()
 
float GetCurrentTick ()
 
float GetCurrentTickByPercentage ()
 
void GetFov (float fov)
 
int GetFreeName ()
 
int GetLastTick ()
 
bool GetMerge ()
 
HBaseModelGetModel ()
 
int GetNextKeyframe (int ticknum, bool forward)
 
void GetPositionMatrix (float *mat)
 
bool GetRenderEveryTick ()
 
void GetTargetMatrix (float *mat)
 
int GetTicksPerSecond ()
 
bool GetUpdateCamera ()
 
bool HasAnimations ()
 
 HBhvBehaviorManager (HBaseModel *model, int tps=10, int delay=0, const char *name=0, const char *version=0, const char *vendor=0)
 
bool IsAtFinalTick ()
 
bool IsPlaying ()
 
void Play ()
 
void RemoveScheduledAnimation (HBhvAnimation *animation)
 
void Reset ()
 
void Rewind ()
 
void ScheduleAllAnimations (bool reset=false)
 
void ScheduleAnimation (HBhvAnimation *animation, float currenttime)
 
void Serialize (HUtilityXMLGenerator *xmlgen)
 
void SetActiveView (HBaseView *view)
 
void SetContinuousPlay (bool cont)
 
void SetCurrentTick (float tick)
 
void SetCurrentTick ()
 
void SetCurrentTickByPercentage (float percentage)
 
void SetCurrentTickByTime (float t)
 
void SetFov (float fov)
 
void SetInfinitePlay (bool inf)
 
void SetMerge (bool merge)
 
void SetPositionMatrix (float *mat)
 
void SetRenderEveryTick (bool everytick)
 
void SetStartTime (float time)
 
void SetTargetMatrix (float *mat)
 
void SetTicksPerSecond (int tps)
 
void SetUpdateCamera (bool updatecamera)
 
void Stop ()
 
virtual bool Tick (float request_time, float actual_time)
 
void WriteToFile (const __wchar_t *filename)
 
void WriteToFile (const char *filename)
 
- Public Member Functions inherited from HTClient
float GetInterval () const
 
float GetNextRequest () const
 
int GetPriority () const
 
HTCStyle GetStyle () const
 
HTClientTickFunction GetTickFunction () const
 
void * GetUserData () const
 
 HTClient (float interval=0.1f, HTCStyle style=HTCS_Invalid, HTClientTickFunction tick_function=0, void *user_data=0)
 
void SetInterval (float interval)
 
void SetNextRequest (float nr)
 
void SetPriorityLowest ()
 
void SetStyle (HTCStyle style)
 
void SetTickFunction (HTClientTickFunction tick_function)
 
void SetUserData (void *user_data)
 

Static Public Member Functions

static void ProcessXMLData (HBaseModel *model, const char *buffer)
 
static void ReadFromFile (HBaseModel *model, const __wchar_t *filename)
 
static void ReadFromFile (HBaseModel *model, const char *filename)
 
static void * XMLCallback (HUtilityXMLTag *xt, bool open, void *m_pExtraData)
 

Protected Member Functions

HBhvInterpolatorAddKeyframe (const char *animname, const char *IntType, HKeyframe *keyframe, int tick)
 
bool EvaluateCollision (HBhvTargetObject *tob)
 
void ResolveInstances ()
 

Protected Attributes

struct vlist_s * m_AnimationList
 
bool m_bCameraUpdated
 
bool m_bContinuousPlay
 
bool m_bInfinitePlay
 
bool m_bMerge
 
bool m_bPlaying
 
bool m_bRenderEveryFrame
 
bool m_bShellSelectionActive
 
bool m_bUpdateCamera
 
float m_CurrentTick
 
int m_Delay
 
float m_fov
 
int m_LastTick
 
char m_Name [BHV_MAX_NAME_LENGTH]
 
HBaseModelm_pModel
 
float m_positionmatrix [16]
 
HBaseViewm_pView
 
struct vlist_s * m_ScheduledAnimationList
 
struct vlist_s * m_SensorList
 
float m_StartTime
 
float m_targetmatrix [16]
 
struct vlist_s * m_TargetObjectList
 
int m_Tps
 
char m_Vendor [BHV_MAX_VENDOR_LENGTH]
 
char m_Version [BHV_MAX_VERSION_LENGTH]
 
- Protected Attributes inherited from HTClient
float mt_interval
 
float mt_next_request
 
int mt_priority
 
HTCStyle mt_style
 
HTClientTickFunction mt_tick_function
 
void * mt_user_data
 

Detailed Description

The HBhvBehaviorManager class stores and manages all animation related data.

The HBhvBehaviorManager class stores a list of animations, sensors and target objects and manages them on a frame by frame basis. The animation logic assumes that it will be the only logic manipulating modelling matrices for any segment that it is operating on. If such segments already have modelling matrices, they will be replaced, and this may produce unexpected results. To address this, you could have the geometric primitives in any of these segments first be transformed through the modelling matrices.

Constructor & Destructor Documentation

◆ HBhvBehaviorManager()

HBhvBehaviorManager::HBhvBehaviorManager ( HBaseModel model,
int  tps = 10,
int  delay = 0,
const char *  name = 0,
const char *  version = 0,
const char *  vendor = 0 
)

Constructs an HBhvBehaviorManager object.

Parameters
modelA pointer to HBaseModel object that this BehaviorManager object belongs to.
tpsThe ticks per second value for measuring time.
delayThe initial delay for this HBhvBehaviorManager object.
nameThe name of the behavior manager.
versionAdditional Version Information.
vendorAdditional Vendor Information.

Member Function Documentation

◆ ActivateAllAnimations()

void HBhvBehaviorManager::ActivateAllAnimations ( )

This method activates all items on the animation list. When animations are not active, they can only be triggered by sensors.

◆ ActivateAnimationByName()

void HBhvBehaviorManager::ActivateAnimationByName ( const char *  name,
bool  AllowPartial = true 
)

This method activates an animation given its partial or full name. When an animation is deactivated, it can only be triggered by a sensor.

Parameters
nameThe name of the animation.
AllowPartialPass true if you want to allow a partial name to be used for determining animation.

◆ AddAnimation() [1/3]

HBhvAnimation* HBhvBehaviorManager::AddAnimation ( const char *  name,
const char *  target,
HBhvTimeline timeline,
HBhvInterpolator interpolator 
)

This method creates a new animation based on given name, target, timeline and interpolator. Then it adds the new animation to the animation list.

Parameters
nameThe name of the new animation.
targetA pointer to the target for the new animation.
timelineA pointer to the timeline for the new animation.
interpolatorA pointer to the interpolator for the new animation.
Returns
A pointer to the newly created animation.

◆ AddAnimation() [2/3]

void HBhvBehaviorManager::AddAnimation ( HBhvAnimation animation)

This method adds a given animation to the animation list.

Parameters
animationAnimation to add to animation list

◆ AddAnimation() [3/3]

HBhvAnimation* HBhvBehaviorManager::AddAnimation ( const char *  name,
const char *  targetpath,
HPoint pivot 
)

This method creates a new named animation.

Parameters
nameThe name of the new animation
targetpathSegment Path specifying the segment the animation should operate on
pivotCenter Point of the target (allows for off-center rotation)
Returns
Pointer to newly created Animation Object

◆ AddAttributeSwitchKeyframe()

void HBhvBehaviorManager::AddAttributeSwitchKeyframe ( const char *  animname,
int  tick,
const char *  att 
)

This method creates a new Attribute Switch keyframe for a given animation. They attribute switch keyframes changes they attributes of your target object by giving it the specified style segment.

Parameters
animnameThe name of the animation
tickLocation of new keyframe in timeline
attPath to segment containing attributes for keyframe

◆ AddAxisRotateKeyframe()

void HBhvBehaviorManager::AddAxisRotateKeyframe ( const char *  animname,
int  tick,
float  rot,
HPoint axis = 0 
)

This method creates a new Axis Rotate keyframe for a given animation. The axis rotate keyframe lets you specify the angle of rotation and axis of rotation for you target object.

Parameters
animnameThe name of the animation
tickLocation of new keyframe in timeline
rotAngle of rotation of keyframe
axisAxis of rotation for all keyframes

◆ AddColorKeyframe()

void HBhvBehaviorManager::AddColorKeyframe ( const char *  animname,
int  tick,
HPoint  color,
const char *  colorcomponent = 0,
const char *  geomtype = 0 
)

This method creates a new color keyframe for a given animation.

Parameters
animnameThe name of the animation
tickLocation of new keyframe in timeline
colorrgb color specification for keyframe
colorcomponentColor component (diffuse, specular,...) for all keyframes
geomtypeGeometry Type the color applies to for all keyframes

◆ AddColorMorphDataToAnimation()

void HBhvBehaviorManager::AddColorMorphDataToAnimation ( const char *  animname,
HPoint md,
int  pnum,
HBaseModel model,
int  pos = -1 
)

This method adds color morph information to a given animation. This function supplies the actual point array and associates an index to it (the first inserted point array has the index 0, the second index 1, etc) This method should be called AFTER defining the interpolator keyframe list using the AddColorMorphInterpolator method.

Parameters
mdPointer to morph data rgb color list
pnumNumber of points in rgb color list
modelPoint to HBaseModel object
posPosition to add morph data to

◆ AddColorMorphInterpolator()

void HBhvBehaviorManager::AddColorMorphInterpolator ( const char *  animname,
int  tick,
const char *  mident,
bool  discrete 
)

This method creates a new color morph keyframe for a given animation. A color morph keyframe tell HOOPS to perform an interpolation on the face colors of your target object from the previous keyframe to the new keyframe.
This method in conjunction with AddColorMorphDataToAnimation.

Parameters
animnameThe name of the animation
tickLocation of new keyframe in timeline
midentColor Morph Data Index
discreteSpecifies either discrete switching between morph data or interpolation for keyframe

◆ AddInstanceCreateKeyframe()

void HBhvBehaviorManager::AddInstanceCreateKeyframe ( const char *  animname,
int  tick,
const char *  instance 
)

This method creates a new Instance Create keyframe for a given animation. This keyframe creates another instance of the target object in the segment tree specified.

Parameters
animnameThe name of the animation
tickLocation of new keyframe in timeline
instancePath to instance which should be created for keyframe

◆ AddKeyframe()

HBhvInterpolator* HBhvBehaviorManager::AddKeyframe ( const char *  animname,
const char *  IntType,
HKeyframe keyframe,
int  tick 
)
protected

This method creates a new keyframe for a given animation

Parameters
animnameThe name of the animation
IntTypeType of Interpolator to create/add to
keyframeKeyframe object to add to interpolator
tickLocation of new keyframe in timeline

◆ AddMatrixKeyframe()

void HBhvBehaviorManager::AddMatrixKeyframe ( const char *  animname,
int  tick,
float  matrix[] 
)

This method creates a new matrix keyframe for a given animation. Pass a matrix that describe the rotation you want for your target object.

Parameters
animnameThe name of the animation
tickLocation of new keyframe in timeline
matrixmatrix describing the transformation for the keyframe

◆ AddPositionKeyframe()

void HBhvBehaviorManager::AddPositionKeyframe ( const char *  animname,
int  tick,
HPoint  pos,
bool  linear 
)

This method creates a new position keyframe for a given animation. The position keyframe allows you to specify a new position for your target object. The interpolated path can be a linear or spline movement.

Parameters
animnameThe name of the animation
tickLocation of new keyframe in timeline
pos3d coordinate of keyframe
linearSpecifies if keyframe defines linear movement or spline movement

◆ AddQuatSquadKeyframe()

void HBhvBehaviorManager::AddQuatSquadKeyframe ( const char *  animname,
int  tick,
HQuat  rot,
bool  linear 
)

This method creates a new quaternion keyframe for a given animation. The quaternion key frame lets you specify a rotation for your target object.

Parameters
animnameThe name of the animation
tickLocation of new keyframe in timeline
rotQuaternion for keyframe
linearSpecifies if keyframe defines linear rotation or non linear rotation

◆ AddScaleKeyframe()

void HBhvBehaviorManager::AddScaleKeyframe ( const char *  animname,
int  tick,
HPoint  scale 
)

This method creates a new scale keyframe for a given animation.

Parameters
animnameThe name of the animation
tickLocation of new keyframe in timeline
posx/y/z/ scale values for keyframe

◆ AddSegmentMoveKeyframe()

void HBhvBehaviorManager::AddSegmentMoveKeyframe ( const char *  animname,
int  tick,
char *  path 
)

This method creates a new Segment Move keyframe for a given animation. The current implementation only allows one keyframe of this animation type to exist in a timeline. The segment move keyframe allows you to change the segment path of your target object.

Parameters
animnameThe name of the animation
tickLocation of new keyframe in timeline
pathSegment path for keyframe that defines where to move segment to. The leaf segment of the path will be replaced by the name of the target segment

◆ AddSegmentSwitchKeyframe()

void HBhvBehaviorManager::AddSegmentSwitchKeyframe ( const char *  animname,
int  tick,
const char *  ss 
)

This method creates a new Segment Switch keyframe for a given animation. This segment switch keyframe unset the visibility of the object specified in the keyframe.

Parameters
animnameThe name of the animation
tickLocation of new keyframe in timeline
ssPath to segment for which visibility should be turned on for keyframe

◆ AddSensor()

void HBhvBehaviorManager::AddSensor ( HBhvSensor sensor)

This method adds a given sensor to the sensor list.

Parameters
sensorSensor to add to sensor list.

◆ AddTargetObject()

void HBhvBehaviorManager::AddTargetObject ( HBhvTargetObject targetobject)

This method adds the given target object to the target object list.

Parameters
targetobjectThe target object to added.

◆ AddTrailKeyframe()

void HBhvBehaviorManager::AddTrailKeyframe ( const char *  animname,
int  tick,
HPoint  pos,
bool  linear,
TrailInterpolatorType *  trailtype = 0,
int *  weight = 0,
const char *  style = 0,
const char *  color = 0 
)

This method creates a new trail keyframe for a given animation. Adding a trail keyframe tells HOOPS to draw a line from the position of the previous keyframe to the position of the keyframe you are adding.

Parameters
animnameThe name of the animation
tickLocation of new keyframe in timeline
pos3d coordinate of keyframe
linearSpecifies if keyframe defines linear movement or spline movement
trailtypeTrailtype for all keyframes
weightTrail weight for all keyframes
styleLine style for all keyframes
colorColor for all keyframes

◆ AddVertexMorphDataToAnimation()

void HBhvBehaviorManager::AddVertexMorphDataToAnimation ( const char *  animname,
HPoint md,
int  pnum,
HBaseModel model,
int  pos = -1 
)

This method adds vertex morph information to a given animation. This function supplies the actual point array and associates an index to it (the first inserted point array has the index 0, the second index 1, etc) This method should be called AFTER defining the interpolator keyframe list using the AddVertexMorphInterpolator method.

Parameters
mdPointer to morph data vertex list
pnumNumber of points in vertex list
modelPoint to HBaseModel object
posPosition to add morph data to

◆ AddVertexMorphInterpolator()

void HBhvBehaviorManager::AddVertexMorphInterpolator ( const char *  animname,
int  tick,
const char *  mident,
bool  discrete 
)

This method creates a new vertex morph keyframe for a given animation. This interpolator's behavior is described in more detail under the AddVertexMorphDataToAnimation method.

Parameters
animnameThe name of the animation
tickLocation of new keyframe in timeline
midentVertex Morph Data Index
discreteSpecifies either discrete switching between morph data or interpolation for keyframe

◆ CameraUpdated()

void HBhvBehaviorManager::CameraUpdated ( )
inline

Use this method to indicate that camera was updated during animation.

◆ Continue()

void HBhvBehaviorManager::Continue ( )

Reactivates the execution of items on the schedule animation list.

◆ CreateTargetObjectByPath()

HBhvTargetObject* HBhvBehaviorManager::CreateTargetObjectByPath ( const char *  name,
const char *  path 
)

This method takes the given name and target and searches through the target object list. If a target object corresponding to the name and path exists, it returns that target object. If there are no matches, it creates a new one with the given name and path and adds it to the target object list.

Parameters
nameThe name of the new target object.
pathThe path of the new target object.
Returns
A newly created target object or an already existing target object.

◆ DeactivateAllAnimations()

void HBhvBehaviorManager::DeactivateAllAnimations ( )

This method deactivates all the items in the animation list. If an animation is deactivated, it can only be triggered by a sensor.

◆ DeactivateAnimationByName()

void HBhvBehaviorManager::DeactivateAnimationByName ( const char *  name,
bool  AllowPartial = true 
)

This method deactivates an animation given its full or partial name. When an animation is deactivated, it can only be triggered by a sensor.

Parameters
nameThe name of the animation.
AllowPartialPass true if you want to allow a partial name to be used for determining animation.

◆ DeleteAllAnimations()

void HBhvBehaviorManager::DeleteAllAnimations ( )

This method deletes all animations and associated objects

◆ DeleteAnimation()

void HBhvBehaviorManager::DeleteAnimation ( HBhvAnimation animation)

Removes the given animation from the animation list and then deletes it.

Parameters
animationPass a pointer to the animation you want to delete.

◆ EvaluateCollision()

bool HBhvBehaviorManager::EvaluateCollision ( HBhvTargetObject tob)
protected

Determine if any collisions have occurred for specified target object.

Parameters
tobA pointer to the target object.

◆ ExecuteAnimations()

void HBhvBehaviorManager::ExecuteAnimations ( float  currenttick,
float  starttick 
)

Executes all the scheduled animations.

Parameters
currenttickThe current time in ticks.
starttickThe start time in ticks. If you pass -1, currenttick will be the start time.

◆ FindAnimation()

HBhvAnimation* HBhvBehaviorManager::FindAnimation ( const char *  target,
const char *  interpolatortype 
)

Searches for an animation that matches the given target string and interpolator type.

Parameters
targetThe target descriptor to search for in animation instance. You can use HBhvTargetObject::CreateTargetSting() to generate this string.
interpolatortypeThe interpolator type to search for in animation instance.
Returns
A pointer to the matching animation or null if no animation was found.

◆ FindAnimationByName()

HBhvAnimation* HBhvBehaviorManager::FindAnimationByName ( const char *  name)

Searches for an animation by name.

Parameters
nameThe name of the animation instance.
Returns
A pointer to the matching animation or null if no animation was found.

◆ FindSensorByName()

HBhvSensor* HBhvBehaviorManager::FindSensorByName ( const char *  name)

Searches for a sensor by name.

Parameters
nameThe name of the sensor to search for.
Returns
A pointer to the matching sensor or null if no sensor was found.

◆ FindTargetObjectByName()

HBhvTargetObject* HBhvBehaviorManager::FindTargetObjectByName ( const char *  name)

This method searches the target object list for target object by name.

Parameters
nameThe name of the target object.
Returns
A pointer to the target object with the given name or null if no target. object corresponding to the given name was found.

◆ FindTargetObjectByPath()

HBhvTargetObject* HBhvBehaviorManager::FindTargetObjectByPath ( const char *  path)

Searches for a target object given a path.

Parameters
pathThe path of the target object.
Returns
A pointer to the target object with the given name or null if no target object was found.

◆ GetActiveSceneKey()

HC_KEY HBhvBehaviorManager::GetActiveSceneKey ( )
Returns
The key to active scene. This key will be used for camera manipulation.

◆ GetActiveView()

HBaseView* HBhvBehaviorManager::GetActiveView ( )
inline
Returns
A pointer to the HBaseView object which camera manipulations will be applied to.

◆ GetAnimationList()

vlist_s* HBhvBehaviorManager::GetAnimationList ( )
inline
Returns
A pointer to the current animation list. Note this information is for read-only purpose. To modify any information in animation list, please use the methods provided by this class.

◆ GetCameraUpdated()

bool HBhvBehaviorManager::GetCameraUpdated ( )
inline
Returns
True if camera has been changed during animation and false if the camera has not been changed.

◆ GetContinuousPlay()

bool HBhvBehaviorManager::GetContinuousPlay ( )
inline
Returns
True if the animation list loops continuously and false if the animation will only play through once and then stop. Note that if infinite play is active, it will override the continuous play behavior.

◆ GetCurrentTick()

float HBhvBehaviorManager::GetCurrentTick ( )
inline
Returns
The current tick value.

◆ GetCurrentTickByPercentage()

float HBhvBehaviorManager::GetCurrentTickByPercentage ( )
Returns
The percentage value of the currrent tick in relation to the total length of all animations.

◆ GetFov()

void HBhvBehaviorManager::GetFov ( float  fov)
inline

This method has not been implemented yet.

◆ GetFreeName()

int HBhvBehaviorManager::GetFreeName ( )

This utility method finds a unique animation name. This method only works if you are using an incremented naming scheme.

Returns
Unused int value indicating free name for a new animation.

◆ GetLastTick()

int HBhvBehaviorManager::GetLastTick ( )
Returns
The last tick of all items in the animation list.

◆ GetMerge()

bool HBhvBehaviorManager::GetMerge ( )
inline
Returns
True if new animation data is merged with existing animation.

◆ GetModel()

HBaseModel* HBhvBehaviorManager::GetModel ( )
inline
Returns
A pointer to the model object

◆ GetNextKeyframe()

int HBhvBehaviorManager::GetNextKeyframe ( int  ticknum,
bool  forward 
)

Given a tick number, this method finds the next closest keyframe.

Parameters
ticknumThe tick to calculate next keyframe from.
forwardPass true to find next closest keyframe or false to find the previous closest keyframe.
Returns
The keyframe location in tick if a keyframe is found or the given ticknum if no keyframe was found.

◆ GetPositionMatrix()

void HBhvBehaviorManager::GetPositionMatrix ( float *  mat)
inline

Returns the position matrix used by interpolators for camera interpolation.

◆ GetRenderEveryTick()

bool HBhvBehaviorManager::GetRenderEveryTick ( )
inline
Returns
True if HOOPS will not interpolate between ticks and false if HOOPS will interpolate between ticks.

◆ GetTargetMatrix()

void HBhvBehaviorManager::GetTargetMatrix ( float *  mat)
inline
Returns
The temporary modelling matrix for the target object. This matrix is used by interpolators for camera interpolation.

◆ GetTicksPerSecond()

int HBhvBehaviorManager::GetTicksPerSecond ( )
inline
Returns
The number of ticks per second.

◆ GetUpdateCamera()

bool HBhvBehaviorManager::GetUpdateCamera ( )
inline
Returns
True if HOOPS will update camera during animation and false if HOOPS will not update camera.

◆ HasAnimations()

bool HBhvBehaviorManager::HasAnimations ( )
Returns
True if at least one animation exists or false if no animation exists.

◆ IsAtFinalTick()

bool HBhvBehaviorManager::IsAtFinalTick ( )
Returns
True if the current tick is greater than or equal to the last tick in the animation timeline.

◆ IsPlaying()

bool HBhvBehaviorManager::IsPlaying ( )
inline
Returns
True if animations are currently playing or false if no animations are playing.

◆ Play()

void HBhvBehaviorManager::Play ( )

Starts the execution of items on the animation list, registers with MVO timer and starts playing at the start time.

◆ ProcessXMLData()

static void HBhvBehaviorManager::ProcessXMLData ( HBaseModel model,
const char *  buffer 
)
static

Sets up the XML parser to read animation related xml tags.

Parameters
modelA pointer to the model object.
bufferA pointer to the memory buffer containing XML data.

◆ ReadFromFile()

static void HBhvBehaviorManager::ReadFromFile ( HBaseModel model,
const __wchar_t *  filename 
)
static

Reads XML data containing animation tags from a file and loads it into memory.

Parameters
modelA pointer to the HBaseModel object.
filenameFilename

◆ RemoveScheduledAnimation()

void HBhvBehaviorManager::RemoveScheduledAnimation ( HBhvAnimation animation)

Removes the specified animation from the animation list.

Parameters
animationA pointer to the animation that you want removed.

◆ Reset()

void HBhvBehaviorManager::Reset ( )

Resets all animations.

◆ ResolveInstances()

void HBhvBehaviorManager::ResolveInstances ( )
protected

This method is not yet implemented.

◆ Rewind()

void HBhvBehaviorManager::Rewind ( )

Stops the execution of all animations and rewinds to the start.

◆ ScheduleAllAnimations()

void HBhvBehaviorManager::ScheduleAllAnimations ( bool  reset = false)

Places all animations in the scheduled animation list.

◆ ScheduleAnimation()

void HBhvBehaviorManager::ScheduleAnimation ( HBhvAnimation animation,
float  currenttime 
)

This method schedules the given animation for immediate execution.

Parameters
animationA pointer to the animation you want to schedule for execution
currenttimeThe start time for the animation in ticks.

◆ Serialize()

void HBhvBehaviorManager::Serialize ( HUtilityXMLGenerator *  xmlgen)

This method writes XML data to a buffer.

Parameters
xmlgenA pointer to an XML generator that creates valid XML blocks.

◆ SetActiveView()

void HBhvBehaviorManager::SetActiveView ( HBaseView view)

Use this method to determine which view to apply camera manipulations.

Parameters
viewA pointer to the HBaseView object.

◆ SetContinuousPlay()

void HBhvBehaviorManager::SetContinuousPlay ( bool  cont)
inline

Enables/disables continuous playing of the animation list. In other words, if continuous play is on, when the last tick is reached, everything is rewound and starts playing from the beginning again. Note that if infinite play is active, it will override the continuous play behavior.

Parameters
contPass true to enable continuous play or false to play animations once.

◆ SetCurrentTick() [1/2]

void HBhvBehaviorManager::SetCurrentTick ( float  tick)

Set the current ticks. If the animation is currently playing, it will make an adjustment to m_StartTime based on the difference between old and new tick values.

Parameters
tickThe tick value.

◆ SetCurrentTick() [2/2]

void HBhvBehaviorManager::SetCurrentTick ( )

Set current tick based on current time.

◆ SetCurrentTickByPercentage()

void HBhvBehaviorManager::SetCurrentTickByPercentage ( float  percentage)

Calculates the current tick based on a given percentage of total length of all animations.

Parameters
percentageThe percentage value used to calculate the current tick.

◆ SetCurrentTickByTime()

void HBhvBehaviorManager::SetCurrentTickByTime ( float  t)
inline

Sets the current tick based on a given time.

Parameters
tThe time in seconds.

◆ SetFov()

void HBhvBehaviorManager::SetFov ( float  fov)
inline

This method has not been implemented yet.

Parameters
fov

◆ SetInfinitePlay()

void HBhvBehaviorManager::SetInfinitePlay ( bool  inf)
inline

Enables/disables infinite play. If infinite play is active, then once the animation begins playing, it will continue to play pass the last tick of the timeline. This means that animations that are looped will continue to play while animations that are not looped will stop. Note that if inifinite play is active, it will override continuous play.

Parameters
infPass true to set infinite play to active or false to set infinite play to inactive.

◆ SetMerge()

void HBhvBehaviorManager::SetMerge ( bool  merge)
inline

Determines if loaded animation data is merged into existing animation.

Parameters
mergePass true if you want to merge animation data.

◆ SetPositionMatrix()

void HBhvBehaviorManager::SetPositionMatrix ( float *  mat)
inline

Sets temporary position matrix used by interpolators for camera interpolation.

Parameters
matThe position matrix.

◆ SetRenderEveryTick()

void HBhvBehaviorManager::SetRenderEveryTick ( bool  everytick)
inline

Enables/disables interpolation between ticks.

Parameters
everytickPass true if you do not want interpolation between ticks and false if you want to interpolate between ticks.

◆ SetStartTime()

void HBhvBehaviorManager::SetStartTime ( float  time)
inline

Sets the animation start time. The HBhvBehaviorManager will use this time as a referenced start time for all its calculations as it iterates through the timeline's array of keyframes.

Parameters
timeThe start time of the animation.

◆ SetTargetMatrix()

void HBhvBehaviorManager::SetTargetMatrix ( float *  mat)
inline

Sets the temporary modelling matrix for the target object. This matrix is used by interpolators for camera interpolation.

Parameters
matThe modelling matrix.

◆ SetTicksPerSecond()

void HBhvBehaviorManager::SetTicksPerSecond ( int  tps)
inline

This method set the number of ticks that will occur per second.

Parameters
tpsThe number of ticks per second.

◆ SetUpdateCamera()

void HBhvBehaviorManager::SetUpdateCamera ( bool  updatecamera)
inline

Use this method to indicate if the camera should be updated during animations.

Parameters
updatecameraPass True to update camera or false if otherwise.

◆ Stop()

void HBhvBehaviorManager::Stop ( )

Pauses the execution of the items on the scheduled animation list.

◆ Tick()

virtual bool HBhvBehaviorManager::Tick ( float  request_time,
float  actual_time 
)
virtual

The timer method that gets called from the HTManager::Tick() function. This method updates the current time and executes animations that are scheduled for the current time.

Reimplemented from HTClient.

◆ WriteToFile()

void HBhvBehaviorManager::WriteToFile ( const __wchar_t *  filename)

Serializes all animation data to buffer and writes the buffer to a file.

Parameters
filenameThe filename you want to create.

◆ XMLCallback()

static void* HBhvBehaviorManager::XMLCallback ( HUtilityXMLTag *  xt,
bool  open,
void *  m_pExtraData 
)
static

This is XML read callback which parses XML data and then populates the member variables with the associated values.

Member Data Documentation

◆ m_AnimationList

struct vlist_s* HBhvBehaviorManager::m_AnimationList
protected

The list of all animations.

◆ m_bCameraUpdated

bool HBhvBehaviorManager::m_bCameraUpdated
protected

The value is true if camera has been changed during animation, false if camera has not been changed.

◆ m_bContinuousPlay

bool HBhvBehaviorManager::m_bContinuousPlay
protected

The value is true if the animation list will rewound and played agained whenever the timeline reaches the end or false if the animation list will be played through once and stops at the end.

◆ m_bInfinitePlay

bool HBhvBehaviorManager::m_bInfinitePlay
protected

The flag that determines if animation should run infinitely. In otherwords, the ticks continue to increment.

◆ m_bMerge

bool HBhvBehaviorManager::m_bMerge
protected

The flag that determines if newly loaded animation should be merged into existing data

◆ m_bPlaying

bool HBhvBehaviorManager::m_bPlaying
protected

The value is true if animations are currently playing or false if no animation is playing.

◆ m_bRenderEveryFrame

bool HBhvBehaviorManager::m_bRenderEveryFrame
protected

If true, HOOPS will display every frame of animations. If false, HOOPS will display animations with interpolation.

◆ m_bUpdateCamera

bool HBhvBehaviorManager::m_bUpdateCamera
protected

The value is true if camera manipulations will be performed or false to not execute camera manipulations

◆ m_CurrentTick

float HBhvBehaviorManager::m_CurrentTick
protected

The current time.

◆ m_Delay

int HBhvBehaviorManager::m_Delay
protected

Initial execution delay for this behaviour block

◆ m_fov

float HBhvBehaviorManager::m_fov
protected

This has not been implemented yet.

◆ m_LastTick

int HBhvBehaviorManager::m_LastTick
protected

Final tick of all animations.

◆ m_Name

char HBhvBehaviorManager::m_Name[BHV_MAX_NAME_LENGTH]
protected

The name of the behavior manager object.

◆ m_pModel

HBaseModel* HBhvBehaviorManager::m_pModel
protected

A pointer to HBaseModel object that this behavior manager belongs to.

◆ m_positionmatrix

float HBhvBehaviorManager::m_positionmatrix[16]
protected

The temporary position matrix for interpolators.

◆ m_pView

HBaseView* HBhvBehaviorManager::m_pView
protected

A pointer to HBaseView object that is associated to this behavior manager.

◆ m_ScheduledAnimationList

struct vlist_s* HBhvBehaviorManager::m_ScheduledAnimationList
protected

The list of animations scheduled for execution.

◆ m_SensorList

struct vlist_s* HBhvBehaviorManager::m_SensorList
protected

The list of all sensors.

◆ m_StartTime

float HBhvBehaviorManager::m_StartTime
protected

Start of execution.

◆ m_targetmatrix

float HBhvBehaviorManager::m_targetmatrix[16]
protected

The temporary target matrix for interpolators.

◆ m_TargetObjectList

struct vlist_s* HBhvBehaviorManager::m_TargetObjectList
protected

The list of all target objects.

◆ m_Tps

int HBhvBehaviorManager::m_Tps
protected

The number of ticks per second.

◆ m_Vendor

char HBhvBehaviorManager::m_Vendor[BHV_MAX_VENDOR_LENGTH]
protected

The additional vendor information.

◆ m_Version

char HBhvBehaviorManager::m_Version[BHV_MAX_VERSION_LENGTH]
protected

The version string.


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