#include <HBhvBehaviorManager.h>
Public Member Functions | |
void | FlagForCollision () |
HBhvCameraType | GetCameraType () |
bool | GetCollision () |
const char * | GetName () |
const char * | GetPath () |
HPoint * | GetPivot () |
void | GetPivot (HPoint &pv) |
const char * | GetResolvedPath () |
HC_KEY | GetTargetKey () |
const char * | GetType () |
bool | HasMoved () |
HBhvTargetObject (HBhvBehaviorManager *behaviourmanager, const char *name, const char *path, HPoint *pivot=0) | |
bool | IsEqual (const char *target) |
void | ResetForCollision () |
void | Serialize (HUtilityXMLGenerator *xmlgen) |
void | SetCollision (bool collision) |
void | SetPivot (float x, float y, float z) |
void | SetPivot (HPoint pv) |
void | SetSerializeFromKey (bool sfk) |
void | SetTargetKey (HC_KEY key) |
Static Public Member Functions | |
static void | CreateTargetString (const char *type, const char *path, char *result, bool addquotes=false) |
static void | ResolveTarget (const char *in, char *result, char *targettype, HBaseModel *model, HBhvCameraType &ctype) |
static void * | XMLCallback (HUtilityXMLTag *xt, bool open, void *m_pExtraData) |
Static Protected Member Functions | |
static void | CollapseTarget (const char *target, char *collapsedtarget) |
Protected Attributes | |
bool | m_bCollision |
bool | m_bHasMoved |
bool | m_bSerializeFromKey |
HBhvCameraType | m_CameraType |
HC_KEY | m_key |
char | m_Name [MVO_SMALL_BUFFER_SIZE] |
char | m_Path [MVO_SEGMENT_PATHNAME_BUFFER] |
HBhvBehaviorManager * | m_pBehaviorManager |
HPoint | m_Pivot |
char | m_ResolvedPath [MVO_SEGMENT_PATHNAME_BUFFER] |
char | m_Type [MVO_SMALL_BUFFER_SIZE] |
HBhvTargetObject is mainly used in conjunction with animations and sensors to describe a segment path in the HOOPS database but it can also point to a named animation or sensor. The target string consists of the target type followed by the target descriptor.
"HKEY: " : A unique key identifying the object
Example: Target = "HKEY: 123"
"SPATH:" : A segment path corresponding to the HSF segment structure. SCENE and MODEL are reserved keywords (they refer to the model segment and scene segment as defined in MVO). Specifying SCENE as the segment name can be useful to make global color changes or to do camera movement. "CAMERAPOS" and "CAMERATARGET" are reserved keywords that refer to the camera of the scene. Translation and quaternion rotation will be applied to the camera position/orientation. Camera manipulation will usually require separate animations performed in conjunction. One for the camera movement (using the POS interpolator), one for the camera orientation (using QUAT or EULER) and one for zooming in/out (using the scale interpolator). For "orbit" types of camera animation it is usually preferable to animate the cameratarget, while for walkthroughs the camera position should be used. The camera keywords can appear at the end of a target statement.This is useful if multiple cameras in the scene need to be manipulated.
Examples:
Target = "SPATH: MODEL/car/wheel1"
Target = "SPATH: SCENE/CAMERATARGET"
"ANIM:" The name of an animation tag
Example: Target = "ANIM: a1"
"SSR:" The name of a Sensor tag
Example: Target = "SSR: s1"
HBhvTargetObject::HBhvTargetObject | ( | HBhvBehaviorManager * | behaviourmanager, | |
const char * | name, | |||
const char * | path, | |||
HPoint * | pivot = 0 | |||
) |
Constructs an HBhvTargetObject object.
behaviourmanager | A pointer to HBhvBehaviorManager object that is associated with this target object. | |
name | The name of target object. | |
path | The target description. You can use CreateTargetString to generate the path for this target object. | |
pivot | Sets the center of rotation if the target object is a segment in the HOOPS segment hierachy |
static void HBhvTargetObject::CollapseTarget | ( | const char * | target, | |
char * | collapsedtarget | |||
) | [static, protected] |
This method is for internal use only.
static void HBhvTargetObject::CreateTargetString | ( | const char * | type, | |
const char * | path, | |||
char * | result, | |||
bool | addquotes = false | |||
) | [static] |
This utitlity method combines a target type and path to one target into one string. The generated name can be used as an identifier to pass to the method IsEqual() and the methods HBhvBehaviorManager::AddAnimation and HBhvBehaviorManager::FindAnimation to identify a target by a string.
type | The type of the target such as HKEY, SPATH, ANIM or SSR(sensor). | |
path | If the type is SPATH, path is the path to the segment. If the type is HKEY, then path is the unique HKEY identifier. If type is ANIM or SSR, then pass a the name. | |
result | Returns a pointer to the combined target string. | |
addquotes | Pass true if target string should be enclosed by quotation marks or false if you don't want quotes. |
void HBhvTargetObject::FlagForCollision | ( | ) | [inline] |
Call this method to indicate that this object has moved and should be checked for collision with other objects.
HBhvCameraType HBhvTargetObject::GetCameraType | ( | ) | [inline] |
bool HBhvTargetObject::GetCollision | ( | ) | [inline] |
const char* HBhvTargetObject::GetName | ( | ) | [inline] |
const char* HBhvTargetObject::GetPath | ( | ) | [inline] |
HPoint* HBhvTargetObject::GetPivot | ( | ) | [inline] |
void HBhvTargetObject::GetPivot | ( | HPoint & | pv | ) | [inline] |
Returns the center of rotation for the target object.
const char* HBhvTargetObject::GetResolvedPath | ( | ) | [inline] |
HC_KEY HBhvTargetObject::GetTargetKey | ( | ) |
const char* HBhvTargetObject::GetType | ( | ) | [inline] |
bool HBhvTargetObject::HasMoved | ( | ) | [inline] |
bool HBhvTargetObject::IsEqual | ( | const char * | target | ) |
Compares this target object with another one to determine equality.
target | Pass a target descriptor string. You can generate this string using the CreateTargetString method. |
void HBhvTargetObject::ResetForCollision | ( | ) | [inline] |
Call this method indicates this object has not moved and does not need to be checked for collisions with other objects.
static void HBhvTargetObject::ResolveTarget | ( | const char * | in, | |
char * | result, | |||
char * | targettype, | |||
HBaseModel * | model, | |||
HBhvCameraType & | ctype | |||
) | [static] |
Given an unexpanded target descriptor, this method returns the corresponding HOOPS segment path, target type and camera type for this target object.
in | The target string to evaluate. | |
result | Returns the expanded target string. | |
targettype | Returns the type of target. | |
model | Pointer to HBaseModel object. | |
ctype | Returns the camera type. |
void HBhvTargetObject::Serialize | ( | HUtilityXMLGenerator * | xmlgen | ) |
Writes the XML data for this target object.
xmlgen | A pointer to the xml generator that creates correct xml blocks |
void HBhvTargetObject::SetCollision | ( | bool | collision | ) | [inline] |
This method allows you to indicate if you want this object to be evaluated for collisions. Any collision between this object and the environment will trigger a HAnimationListener::ObjectCollisionEvent event, which can in turn be received by any class deriving from HAnimationListener. This allows an application to be aware of inter-object collisions during an animation and provide visual feedback on the (typically by highlighting the collided objects).
collision | Pass true if you want this object to be evaluated for collision. |
void HBhvTargetObject::SetPivot | ( | float | x, | |
float | y, | |||
float | z | |||
) | [inline] |
Sets the center of rotation for the target object.
x | The x coordinate position of the pivot point. | |
y | The y coordinate position of the pivot point. | |
z | The z coordinate position of the pivot point. |
References HPoint::Set().
void HBhvTargetObject::SetPivot | ( | HPoint | pv | ) | [inline] |
Sets the center of rotation for this target object.
pv | The pivot point. |
static void* HBhvTargetObject::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.
bool HBhvTargetObject::m_bCollision [protected] |
A flag indicating if this object should be evaluated for collisions.
bool HBhvTargetObject::m_bHasMoved [protected] |
A flag indicating if object has moved during one animation slice.
HBhvCameraType HBhvTargetObject::m_CameraType [protected] |
The type of camera.
HC_KEY HBhvTargetObject::m_key [protected] |
The key of target object.
char HBhvTargetObject::m_Name[MVO_SMALL_BUFFER_SIZE] [protected] |
The name of this target object.
char HBhvTargetObject::m_Path[MVO_SEGMENT_PATHNAME_BUFFER] [protected] |
The unresolved path.
HBhvBehaviorManager* HBhvTargetObject::m_pBehaviorManager [protected] |
A pointer to BehaviorManager object that this animation belongs to.
HPoint HBhvTargetObject::m_Pivot [protected] |
The center of rotation.
char HBhvTargetObject::m_ResolvedPath[MVO_SEGMENT_PATHNAME_BUFFER] [protected] |
The resolved path.
char HBhvTargetObject::m_Type[MVO_SMALL_BUFFER_SIZE] [protected] |
The target type.