Collide character interface.
A collide character wraps a CollideObject and provide methods to handle basic collision detection and dynamics. It allows to simply implement "game" like movement for characters and objects.
The collide object of the character is a cylinder scaled to the approriate height / radius.
Properties | |
| virtual void | SetClass (iHString *ahspClass)=0 |
| Set the class of the object. {Property}. More... | |
| virtual iHString * | GetClass () const =0 |
| Get the class of the object. {Property}. More... | |
| virtual void | SetFeetClass (iHString *ahspFeetClass)=0 |
| Set the feet class of the object. {Property}. More... | |
| virtual iHString * | GetFeetClass () const =0 |
| Get the feet class of the object. {Property}. More... | |
| virtual void | SetHeadClass (iHString *ahspHeadClass)=0 |
| Set the head class of the object. {Property}. More... | |
| virtual iHString * | GetHeadClass () const =0 |
| Get the head class of the object. {Property}. More... | |
| virtual iCollideShape * | GetShape () const =0 |
| Get the collide shape of the character. {Property}. More... | |
| virtual iCollideObject * | GetObject () const =0 |
| Get the collide object of the character. {Property}. More... | |
| virtual void | SetHeight (tF32 afHeight)=0 |
| Instantly set the height of the character. {Property}. More... | |
| virtual tF32 | GetHeight () const =0 |
| Instantly set the height of the character. {Property}. More... | |
| virtual void | SetRadius (tF32 afRadius)=0 |
| Set the collision radius of the character. {Property}. More... | |
| virtual tF32 | GetRadius () const =0 |
| Get the collision radius of the character. {Property}. More... | |
| virtual void | SetFeetRadius (tF32 afFeetRadius)=0 |
| Set the feet radius of the character. {Property}. More... | |
| virtual tF32 | GetFeetRadius () const =0 |
| Get the feet radius of the character. {Property}. More... | |
| virtual void | SetHeadRadius (tF32 afHeadRadius)=0 |
| Set the head radius of the character. {Property}. More... | |
| virtual tF32 | GetHeadRadius () const =0 |
| Get the head radius of the character. {Property}. More... | |
| virtual void | SetStairHeight (tF32 afHeight)=0 |
| Set the maximum height of slopes and steps a character can climb. {Property}. More... | |
| virtual tF32 | GetStairHeight () const =0 |
| Get the maximum height of slopes and steps a character can climb. {Property}. More... | |
| virtual void | SetAcceleration (eCollideCharacterMovement aMovement, tF32 afAcc)=0 |
| Set the acceleration of the character. {Property}. More... | |
| virtual tF32 | GetAcceleration (eCollideCharacterMovement aMovement) const =0 |
| Get the acceleration of the character. {Property}. More... | |
| virtual void | SetDeceleration (eCollideCharacterMovement aMovement, tF32 afAcc)=0 |
| Set the deceleration of the character. {Property}. More... | |
| virtual tF32 | GetDeceleration (eCollideCharacterMovement aMovement) const =0 |
| Get the deceleration of the character. {Property}. More... | |
| virtual void | SetVelocity (eCollideCharacterMovement aMovement, tF32 afAcc)=0 |
| Instantly set the velocity of the character. {Property}. More... | |
| virtual tF32 | GetVelocity (eCollideCharacterMovement aMovement) const =0 |
| Get the current velocity of the character. {Property}. More... | |
| virtual void | SetMaxVelocity (eCollideCharacterMovement aMovement, tF32 afAcc)=0 |
| Set the maximum acceleration of the character. {Property}. More... | |
| virtual tF32 | GetMaxVelocity (eCollideCharacterMovement aMovement) const =0 |
| Get the maximum acceleration of the character. {Property}. More... | |
Position | |
| virtual void | SetCenterPosition (const sVec3f &aPosition)=0 |
| Set the position of the center of the character. More... | |
| virtual sVec3f | GetCenterPosition () const =0 |
| Get the position of the center of the character. More... | |
| virtual void | SetFeetPosition (const sVec3f &aFeetPosition)=0 |
| Set the center position of the character from a "feet" position. More... | |
| virtual sVec3f | FeetToCenterPosition (const sVec3f &aFeetPos) const =0 |
| Converts a "feet" position to a "center" position. More... | |
| virtual sVec3f | GetFeetPosition () const =0 |
| Get the "feet" position of the character. More... | |
| virtual sVec3f | ToFeetPosition (const sVec3f &aPos) const =0 |
| Converts a "center" position to a "feet" position. More... | |
| virtual void | SetEyePosition (const sVec3f &aEyePosition, tF32 afEyeHeightFromFeet)=0 |
| Set the center position of the character from an "eye" position. More... | |
| virtual sVec3f | EyeToCenterPosition (const sVec3f &aEyePos, tF32 afEyeHeightFromFeet) const =0 |
| Converts a "eye" position to a "center" position. More... | |
| virtual sVec3f | GetEyePosition (tF32 afEyeHeightFromFeet) const =0 |
| Get the "eye" position of the character. More... | |
| virtual sVec3f | ToEyePosition (const sVec3f &aPos, tF32 afEyeHeightFromFeet) const =0 |
| Converts a "center" position to a "eye" position. More... | |
Queries | |
| virtual tBool | ChangeHeight (iCollideQuery *apQuery, tF32 afNewHeight)=0 |
| Changes the height of the character if the environment allows. More... | |
| virtual tBool | TestCollision (iCollideQuery *apQuery, const sVec3f &avPos)=0 |
| Checks if the character collides at the specified position where position is the center of the collider. More... | |
| virtual void | Accelerate (eCollideCharacterMovement aMovement, tF32 afValue)=0 |
| Accelerate the character in the specified direction. More... | |
| virtual void | Move (eCollideCharacterMovement aMovement, tF32 afValue)=0 |
| Moves the character in the specified direction. More... | |
| virtual eCollideCharacterStatus | ApplyMovement (tF32 aFrameTime, iCollideQuery *apQuery, const sVec3f &aFwd, const sVec3f &aRight)=0 |
| Apply movement and collision resolution to the character. More... | |
| virtual eCollideCharacterStatus | ApplyGravity (tF32 aFrameTime, iCollideQuery *apQuery)=0 |
| Apply gravity and stairs. More... | |
| virtual eCollideCharacterStatus | ApplyDeceleration (tF32 aFrameTime)=0 |
| Apply deceleration. More... | |
Additional Inherited Members | |
Public Member Functions inherited from iUnknown | |
| virtual tBool | IsOK () const =0 |
| Check if the object is valid. More... | |
| virtual tI32 | AddRef ()=0 |
| Signal that one more reference of the object has been created. More... | |
| virtual tI32 | Release ()=0 |
| Release a reference of the object. More... | |
| virtual void | DeleteThis ()=0 |
| Bypass any reference counting and delete this object. More... | |
| virtual void | Invalidate ()=0 |
| Invalidate the object. More... | |
| virtual iUnknown * | QueryInterface (const tUUID &aIID)=0 |
| Query an interface. More... | |
| virtual void | ListInterfaces (iMutableCollection *apLst, tU32 anFlags) const =0 |
| Fill a UUID list containing the UUIDs of the implemented interfaces. More... | |
| virtual tI32 | SetNumRefs (tI32 anNumRefs)=0 |
| Set the reference counter directly. More... | |
| virtual tI32 | GetNumRefs () const =0 |
| Get the number of references to this object. More... | |
|
pure virtual |
Get the class of the object. {Property}.
Set the feet class of the object. {Property}.
|
pure virtual |
Get the feet class of the object. {Property}.
Set the head class of the object. {Property}.
|
pure virtual |
Get the head class of the object. {Property}.
|
pure virtual |
Get the collide shape of the character. {Property}.
|
pure virtual |
Get the collide object of the character. {Property}.
Instantly set the height of the character. {Property}.
|
pure virtual |
Instantly set the height of the character. {Property}.
Set the collision radius of the character. {Property}.
|
pure virtual |
Get the collision radius of the character. {Property}.
Set the feet radius of the character. {Property}.
|
pure virtual |
Get the feet radius of the character. {Property}.
Set the head radius of the character. {Property}.
|
pure virtual |
Get the head radius of the character. {Property}.
Set the maximum height of slopes and steps a character can climb. {Property}.
|
pure virtual |
Get the maximum height of slopes and steps a character can climb. {Property}.
|
pure virtual |
Set the acceleration of the character. {Property}.
|
pure virtual |
Get the acceleration of the character. {Property}.
|
pure virtual |
Set the deceleration of the character. {Property}.
|
pure virtual |
Get the deceleration of the character. {Property}.
|
pure virtual |
Instantly set the velocity of the character. {Property}.
|
pure virtual |
Get the current velocity of the character. {Property}.
|
pure virtual |
Set the maximum acceleration of the character. {Property}.
|
pure virtual |
Get the maximum acceleration of the character. {Property}.
Set the position of the center of the character.
| aPosition | is the position to set which is centered in the character. {Property} |
|
pure virtual |
Get the position of the center of the character.
Set the center position of the character from a "feet" position.
| aFeetPosition | the position to set {Property} |
Converts a "feet" position to a "center" position.
| aFeetPos | the center of the character |
|
pure virtual |
Get the "feet" position of the character.
Converts a "center" position to a "feet" position.
| aPos | the center of the character |
Set the center position of the character from an "eye" position.
| aEyePosition | the position to set |
| afEyeHeightFromFeet | is the eye height from the feet of the character. |
|
pure virtual |
Converts a "eye" position to a "center" position.
| aEyePos | the center of the character |
| afEyeHeightFromFeet |
Get the "eye" position of the character.
| afEyeHeightFromFeet | is the eye height from the feet of the character. |
Converts a "center" position to a "eye" position.
| aPos | the center of the character |
| afEyeHeightFromFeet |
|
pure virtual |
Changes the height of the character if the environment allows.
|
pure virtual |
Checks if the character collides at the specified position where position is the center of the collider.
|
pure virtual |
Accelerate the character in the specified direction.
-- ex: Moving forward --
void onForward(tF32 afV) {
mpCharacter->Accelerate(
eCollideCharacterMovement_Forward,
afV * ni::GetLang()->GetFrameTime());
}
| aMovement | is the direction along which the character will accelerate. |
| afValue | the movement "force", will be multiplied by the acceleration of the character, should be frame time dependent. |
|
pure virtual |
Moves the character in the specified direction.
-- ex: Moving forward --
void onForward(tF32 afV) {
mpCharacter->Move(
eCollideCharacterMovement_Forward,
afV * ni::GetLang()->GetFrameTime());
}
| aMovement | is the direction along which the character will move. |
| afValue | should be frame time dependent. |
|
pure virtual |
Apply movement and collision resolution to the character.
| aFrameTime | is the frame time |
| apQuery | |
| aFwd | is the direction in which the character moves forward. |
| aRight | is the direction in which the character moves side-ward. |
|
pure virtual |
Apply gravity and stairs.
| aFrameTime | is the frame time |
| apQuery |
|
pure virtual |
Apply deceleration.
1.8.7