Prop Field Type. More...
#include <dePropFieldType.h>
Public Member Functions | |
Constructors and Destructors | |
| dePropFieldType () | |
| Creates a new prop field type. | |
| ~dePropFieldType () | |
| Cleans up the prop field type. | |
Management | |
| deModel * | GetModel () const |
| Retrieves the model or NULL if not set. | |
| void | SetModel (deModel *model) |
| Sets the model or NULL it not set. | |
| deSkin * | GetSkin () const |
| Retrieves the skin or NULL if not set. | |
| void | SetSkin (deSkin *skin) |
| Sets the skin or NULL if not set. | |
| float | GetRotationPerForce () const |
| Retrieves the rotation per force. | |
| void | SetRotationPerForce (float rotation) |
| Sets the rotation per force. | |
| float | GetRestitution () const |
| Retrieves the restitution. | |
| void | SetRestitution (float restitution) |
| Sets the restitution. | |
| decLayerMask & | GetLayerMask () |
| Retrieves the layer mask. | |
| int | GetGroupNumber () const |
| Retrieves the group number or 0 if not set. | |
| void | SetGroupNumber (int groupNumber) |
| Sets the group number or 0 if not set. | |
| bool | CanHit (const decLayerMask &layerMask, int groupNumber) const |
| Determines if this prop field type can be hit by another object represented by a layer mask and a group number. | |
| int | GetInstanceCount () const |
| Retrieves the number of instances. | |
| void | SetInstanceCount (int count) |
| Sets the number of instances. | |
| dePropFieldInstance & | GetInstanceAt (int index) const |
| Retrieves the instance at the given index. | |
| dePropFieldInstance * | GetInstances () const |
| Retrieves the list of instances. | |
| int | GetBendStateCount () const |
| Retrieves the number of bend states. | |
| void | SetBendStateCount (int count) |
| Sets the number of bend states. | |
| dePropFieldBendState & | GetBendStateAt (int index) const |
| Retrieves the bend state at the given index. | |
| dePropFieldBendState * | GetBendStates () const |
| Retrieves the list of bend states. | |
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 | ( | ) |
Creates a new prop field type.
The instance count has to be at least 1.
| dePropFieldType::~dePropFieldType | ( | ) |
Cleans up the prop field type.
| bool dePropFieldType::CanHit | ( | const decLayerMask & | layerMask, |
| int | groupNumber | ||
| ) | const |
Determines if this prop field type can be hit by another object represented by a layer mask and a group number.
The layer mask and the group number of both entities are checked for a match. Group numbers match only if neither of them is 0.
| dePropFieldBendState& dePropFieldType::GetBendStateAt | ( | int | index ) | const |
Retrieves the bend state at the given index.
| int dePropFieldType::GetBendStateCount | ( | ) | const [inline] |
Retrieves the number of bend states.
| dePropFieldBendState* dePropFieldType::GetBendStates | ( | ) | const [inline] |
Retrieves the 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.
| int dePropFieldType::GetGroupNumber | ( | ) | const [inline] |
Retrieves the group number or 0 if not set.
| dePropFieldInstance& dePropFieldType::GetInstanceAt | ( | int | index ) | const |
Retrieves the instance at the given index.
| int dePropFieldType::GetInstanceCount | ( | ) | const [inline] |
Retrieves the number of instances.
| dePropFieldInstance* dePropFieldType::GetInstances | ( | ) | const [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.
| decLayerMask& dePropFieldType::GetLayerMask | ( | ) | [inline] |
Retrieves the layer mask.
| deModel* dePropFieldType::GetModel | ( | ) | const [inline] |
Retrieves the model or NULL if not set.
| float dePropFieldType::GetRestitution | ( | ) | const [inline] |
Retrieves the restitution.
| float dePropFieldType::GetRotationPerForce | ( | ) | const [inline] |
Retrieves the rotation per force.
| deSkin* dePropFieldType::GetSkin | ( | ) | const [inline] |
Retrieves the skin or NULL if not set.
| void dePropFieldType::SetBendStateCount | ( | int | count ) |
Sets the number of bend states.
| void dePropFieldType::SetGroupNumber | ( | int | groupNumber ) |
Sets the group number or 0 if not set.
| void dePropFieldType::SetInstanceCount | ( | int | count ) |
Sets the number of instances.
| void dePropFieldType::SetModel | ( | deModel * | model ) |
Sets the model or NULL it not set.
| void dePropFieldType::SetRestitution | ( | float | restitution ) |
Sets the restitution.
| void dePropFieldType::SetRotationPerForce | ( | float | rotation ) |
Sets the rotation per force.
| void dePropFieldType::SetSkin | ( | deSkin * | skin ) |
Sets the skin or NULL if not set.
1.7.2