Drag[en]gine Game Engine
1.21
|
Prop Field Type. More...
#include <dePropFieldType.h>
Public Member Functions | |
Constructors and Destructors | |
dePropFieldType () | |
Create new prop field type. The instance count has to be at least 1. More... | |
~dePropFieldType () | |
Clean up prop field type. More... | |
Management | |
deModel * | GetModel () const |
Model or NULL if not set. More... | |
void | SetModel (deModel *model) |
Set model or NULL it not set. More... | |
deSkin * | GetSkin () const |
Skin or NULL if not set. More... | |
void | SetSkin (deSkin *skin) |
Set skin or NULL if not set. More... | |
float | GetRotationPerForce () const |
Rotation per force. More... | |
void | SetRotationPerForce (float rotation) |
Set rotation per force. More... | |
float | GetRestitution () const |
Restitution. More... | |
void | SetRestitution (float restitution) |
Set restitution. More... | |
const decCollisionFilter & | GetCollisionFilter () const |
Collision filter. More... | |
void | SetCollisionFilter (const decCollisionFilter &collisionFilter) |
Set collision filter. More... | |
int | GetInstanceCount () const |
Number of instances. More... | |
void | SetInstanceCount (int count) |
Set number of instances. More... | |
dePropFieldInstance & | GetInstanceAt (int index) const |
Instance at the given index. More... | |
dePropFieldInstance * | GetInstances () const |
int | GetBendStateCount () const |
Number of bend states. More... | |
void | SetBendStateCount (int count) |
Set number of bend states. More... | |
dePropFieldBendState & | GetBendStateAt (int index) const |
Bend state at the given index. More... | |
dePropFieldBendState * | GetBendStates () const |
List of bend states. More... | |
Prop Field Type.
Defines a prop type in a prop field. Each prop type has a static model, a skin and a list of instances. Each instance uses the parameters of the type but has a specific placement. Instances are projected onto the hosting surface. For performance and memory reasons the number of instances is an immutable parameter given during construction time. In games you need to init this number anyways only during loading time and during run time the number is constant. Editors can recreate the type to alter the count of instances. The parent prop field allows to mutate the list of types so this restriction is not a road blocking one.
dePropFieldType::dePropFieldType | ( | ) |
Create new prop field type. The instance count has to be at least 1.
dePropFieldType::~dePropFieldType | ( | ) |
Clean up prop field type.
dePropFieldBendState& dePropFieldType::GetBendStateAt | ( | int | index | ) | const |
Bend state at the given index.
|
inline |
Number of bend states.
|
inline |
List of bend states.
Be careful with this method call as it is one intended only for performance usage. Make sure you to not read or write more than GetBendStateCount elements. This array is not guaranteed to be the same for the entire lifetime of this object but is a continuous list. If possible use the GetBendStateAt method call to obtain the individual bend states as there boundary checks are conducted. If you need direct access due to performance reasons only keep to this pointer for the short time you do some work.
|
inline |
Collision filter.
dePropFieldInstance& dePropFieldType::GetInstanceAt | ( | int | index | ) | const |
Instance at the given index.
|
inline |
Number of instances.
|
inline |
Retrieves the list of instances. Be careful with this method call as it is one intended only for performance usage. Make sure you to not read or write more than GetInstanceCount elements. You can be sure that the returned array is the same for the entire lifetime of this object and contains the instances in a continuous list. If possible use the GetInstanceAt method call to obtain the individual instances as there boundary checks are conducted.
|
inline |
Model or NULL if not set.
|
inline |
Restitution.
|
inline |
Rotation per force.
|
inline |
Skin or NULL if not set.
void dePropFieldType::SetBendStateCount | ( | int | count | ) |
Set number of bend states.
void dePropFieldType::SetCollisionFilter | ( | const decCollisionFilter & | collisionFilter | ) |
Set collision filter.
void dePropFieldType::SetInstanceCount | ( | int | count | ) |
Set number of instances.
void dePropFieldType::SetModel | ( | deModel * | model | ) |
Set model or NULL it not set.
void dePropFieldType::SetRestitution | ( | float | restitution | ) |
Set restitution.
void dePropFieldType::SetRotationPerForce | ( | float | rotation | ) |
Set rotation per force.
void dePropFieldType::SetSkin | ( | deSkin * | skin | ) |
Set skin or NULL if not set.