Classes | Public Types

deColliderAttachment Class Reference

Collider Attachement Object. More...

#include <deColliderAttachment.h>

List of all members.

Classes

struct  sWeight

Public Types

enum  eAttachType { eatStatic, eatRig, eatBone, eatWeight }

Public Member Functions

Constructors and Destructors
 deColliderAttachment (deCollider *collider)
 Creates a new collider attachement object with the given attached collider.
 ~deColliderAttachment ()
 Cleans up the collider attachement object.
Management
int GetAttachType () const
 Retrieves the attach type.
void SetAttachType (int attachType)
 Sets the attach type.
deColliderGetCollider () const
 Retrieves the attached collider.
const decVectorGetPosition () const
 Retrieves the position of the attached collider relative to the parent collider.
void SetPosition (const decVector &position)
 Sets the position of the attached collider relative to the parent collider.
const decQuaternionGetOrientation () const
 Retrieves the orientation of the attached collider relative to the parent collider.
void SetOrientation (const decQuaternion &orientation)
 Sets the orientation of the attached collider relative to the parent collider.
const char * GetTrackBone () const
 Retrieves the name of the bone to track.
void SetTrackBone (const char *bone)
 Sets the name of the bone to track.
deColliderConstraintGetConstraint () const
 Retrieves the constraint of NULL if not set.
void SetConstraint (deColliderConstraint *constraint)
 Sets the constraing or NULL if not set.
Weights
int GetWeightCount () const
 Retrieves the count of weights.
int FindWeightWith (const char *boneIndex) const
 Determines the index of the weight with the given bone or -1 if not found.
const char * GetWeightBoneAt (int index) const
 Retrieves the bone of the indexed weight.
float GetWeightFactorAt (int index) const
 Retrieves the bone weight factor of the indexed weight.
float GetWeightFactorFor (const char *bone) const
 Retrieves the weight factor for a given bone index.
void AddWeight (const char *bone, float factor)
 Add a bone weight factor.
void RemoveWeight (const char *bone)
 Removes a bone weight if existing.
void RemoveAllWeights ()
 Removes all bone weights.

Detailed Description

Collider Attachement Object.

Manages a collider object attached to another collider object. A collider can be attached either implicit or explicit.

Implicit Mode
For the implicit way the state of the rig of the parent collider is copied over to the attached collider. This method only works if both colliders support a rig in one way or the other. Implicit mode is used if no bone weigths are specified.
Explicit Mode
In the explicit case a set of bones with weights is specified which is used to position and orientate the entire attached collider. This method works if the parent collider has a rig in one way or the other. The attached collider can be anything in that case. Explicit mode is used if one or more bone weights are specified.
Author:
Plüss Roland
Version:
1.0
Date:
2008

Member Enumeration Documentation

Enumerator:
eatStatic 
eatRig 

Attach statically.

eatBone 

Attach to full rig.

eatWeight 

Track to one bone.

Weight using multiple bones.


Constructor & Destructor Documentation

deColliderAttachment::deColliderAttachment ( deCollider collider )

Creates a new collider attachement object with the given attached collider.

deColliderAttachment::~deColliderAttachment (  )

Cleans up the collider attachement object.


Member Function Documentation

void deColliderAttachment::AddWeight ( const char *  bone,
float  factor 
)

Add a bone weight factor.

If a weight with this bone already exists the factor is updated otherwise a new weight is added.

int deColliderAttachment::FindWeightWith ( const char *  boneIndex ) const

Determines the index of the weight with the given bone or -1 if not found.

int deColliderAttachment::GetAttachType (  ) const [inline]

Retrieves the attach type.

deCollider* deColliderAttachment::GetCollider (  ) const [inline]

Retrieves the attached collider.

deColliderConstraint* deColliderAttachment::GetConstraint (  ) const [inline]

Retrieves the constraint of NULL if not set.

const decQuaternion& deColliderAttachment::GetOrientation (  ) const [inline]

Retrieves the orientation of the attached collider relative to the parent collider.

const decVector& deColliderAttachment::GetPosition (  ) const [inline]

Retrieves the position of the attached collider relative to the parent collider.

const char* deColliderAttachment::GetTrackBone (  ) const [inline]

Retrieves the name of the bone to track.

const char* deColliderAttachment::GetWeightBoneAt ( int  index ) const

Retrieves the bone of the indexed weight.

int deColliderAttachment::GetWeightCount (  ) const [inline]

Retrieves the count of weights.

float deColliderAttachment::GetWeightFactorAt ( int  index ) const

Retrieves the bone weight factor of the indexed weight.

float deColliderAttachment::GetWeightFactorFor ( const char *  bone ) const

Retrieves the weight factor for a given bone index.

void deColliderAttachment::RemoveAllWeights (  )

Removes all bone weights.

void deColliderAttachment::RemoveWeight ( const char *  bone )

Removes a bone weight if existing.

void deColliderAttachment::SetAttachType ( int  attachType )

Sets the attach type.

void deColliderAttachment::SetConstraint ( deColliderConstraint constraint )

Sets the constraing or NULL if not set.

void deColliderAttachment::SetOrientation ( const decQuaternion orientation )

Sets the orientation of the attached collider relative to the parent collider.

void deColliderAttachment::SetPosition ( const decVector position )

Sets the position of the attached collider relative to the parent collider.

void deColliderAttachment::SetTrackBone ( const char *  bone )

Sets the name of the bone to track.


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