CSpirit Class Reference
The class that represents a spirit in the
CWorld system. A Spirit a cylinderic object that can move and jump like a player. I can also climb inclined surfaces and stairs.
More...
#include <World.h>
List of all members.
Detailed Description
The class that represents a spirit in the
CWorld system. A Spirit a cylinderic object that can move and jump like a player. I can also climb inclined surfaces and stairs.
Constructor & Destructor Documentation
CSpirit::CSpirit |
( |
CWorld * |
world, |
|
|
float |
height, |
|
|
float |
radius, |
|
|
float |
climbheight, |
|
|
float |
maxclimbslope, |
|
|
float |
movespeed, |
|
|
float |
airspeedratio, |
|
|
float |
slidespeedratio | |
|
) |
| | |
Constructor. A spirit must never be created this way. CWorld::Use CreateSphere instead.
- Parameters:
-
Member Function Documentation
void CSpirit::SetDirection |
( |
const Vector3 & |
direction |
) |
|
Sets the direction of the CSpirit. This is a meaningful way to set orientation.
- Parameters:
-
| direction | The direction vector that the spirit will look(local-x = direction). Should not have z component. |
- See also:
- CSpirit::SetOrientation.
void CSpirit::SetOrientation |
( |
const Quaternion & |
orient |
) |
[virtual] |
Sets the orientation of the CSpirit. The direction of the spirit must not have a z-component after setting the orientation.
- See also:
- CSpirit::SetDirection.
Reimplemented from CThing.
void CSpirit::Move |
( |
float |
forward, |
|
|
float |
left | |
|
) |
| | |
Increaese/decreases the movement of the spirit. Actual increase depends on move speed.
- Parameters:
-
| forward | The velocity of the spirit increaes by a factor of forward (the actual increase is movespeed*forward) in the direction of the spirit. |
| left | The velocity of the spirit increaes by a factor of left (the actual increase is movespeed*left) in the left direction of the spirit. |
void CSpirit::Turn |
( |
float |
left_radians |
) |
|
Turns the spirit so changes its looking direction.
- Parameters:
-
| left_radians | The amount of turn to the left expressed in radians. |
void CSpirit::Jump |
( |
float |
speed |
) |
|
Increases the speed of the spirit in upwards direction if it is on the ground.
- Parameters:
-
| speed | The amount of increase. |
int CSpirit::Serialize |
( |
void * |
dest |
) |
[virtual] |
Serializes the CSpirit into a memory location.
- Parameters:
-
| dest | The address of the memory location for serialization. |
- Returns:
- The size of the serialization. The next serialization location must be this bytes beyond dest.
- See also:
- Deserialize
Reimplemented from CThing.
int CSpirit::Deserialize |
( |
void * |
dest |
) |
[virtual] |
Deserializes the CSpirit from a memory location.
- Parameters:
-
| dest | The address of the memory location for deserialization. |
- Returns:
- The size of the deserialization. The next deserialization location must be this bytes beyond dest.
- See also:
- Serialize
Reimplemented from CThing.
void CSpirit::GetMoveFactors |
( |
float * |
forward, |
|
|
float * |
left | |
|
) |
| | |
Gets the move factors of the spirit.
- Parameters:
-
| forward | Pointer to the variable in which the forward move factor value will placed. |
| left | Pointer to the variable in which the left move factor value will placed. |
The documentation for this class was generated from the following file: