Description of movables primitives. More...
#include <u_move_primitive.h>
Inherited by NLPACS::CMovePrimitive.
Public Types | |
| enum | TType { _2DOrientedBox = 0x0, _2DOrientedCylinder = 0x1 } |
Primitive mode. More... | |
| enum | TReaction { DoNothing = 0x0, Slide = 0x10, Reflexion = 0x20, Stop = 0x40 } |
Reaction mode. More... | |
| enum | TTrigger { NotATrigger = 0x0, EnterTrigger = 0x100, ExitTrigger = 0x200, OverlapTrigger = 0x400 } |
Reaction mode. More... | |
| typedef uint32 | TCollisionMask |
| Type of the collision mask. | |
| typedef uint64 | TUserData |
Public Member Functions | |
| virtual | ~UMovePrimitive () |
Setup the primitive static parts. | |
| virtual void | setPrimitiveType (TType type)=0 |
| Set the primitive type. | |
| virtual void | setReactionType (TReaction type)=0 |
| Set the reaction type. | |
| virtual void | setTriggerType (TTrigger type)=0 |
| Set the trigger type. | |
| virtual void | setCollisionMask (TCollisionMask mask)=0 |
| Set the collision mask for this primitive. | |
| virtual void | setOcclusionMask (TCollisionMask mask)=0 |
| Set the occlusion mask for this primitive. | |
| virtual void | setObstacle (bool obstacle)=0 |
| Set the obstacle flag. | |
| virtual void | setAbsorbtion (float attenuation)=0 |
| Set the attenuation of collision for this object. | |
| virtual void | setDontSnapToGround (bool dont)=0 |
| Tells that the primitive should not be snapped to ground. | |
| virtual bool | getDontSnapToGround () const =0 |
| Test if snapping to ground is off. | |
| virtual void | setSize (float width, float depth)=0 |
| Set the box size. | |
| virtual void | setHeight (float height)=0 |
| Set the height. | |
| virtual void | setRadius (float radius)=0 |
| Set the cylinder size. | |
Access the primitive static parts. | |
| virtual TType | getPrimitiveType () const =0 |
| Set the primitive type. | |
| virtual TReaction | getReactionType () const =0 |
| Set the reaction type. | |
| virtual TTrigger | getTriggerType () const =0 |
| Set the trigger type. | |
| virtual TCollisionMask | getCollisionMask () const =0 |
| Set the collision mask for this primitive. | |
| virtual TCollisionMask | getOcclusionMask () const =0 |
| Set the occlusion mask for this primitive. | |
| virtual bool | getObstacle () const =0 |
| Set the obstacle flag. | |
| virtual float | getAbsorbtion () const =0 |
| Set the attenuation of collision for this object. | |
| virtual void | getSize (float &width, float &depth) const =0 |
| Set the box size. | |
| virtual float | getHeight () const =0 |
| Set the height. | |
| virtual float | getRadius () const =0 |
| Set the cylinder size. | |
| virtual bool | isCollisionable () const =0 |
| Return true if the primitive is collisionable. | |
Setup the primitive dynamic parts. | |
| virtual void | setOrientation (double rot, uint8 worldImage)=0 |
| Set the new orientation of the move primitive. | |
Access the primitive dynamic parts. | |
| virtual double | getOrientation (uint8 worldImage) const =0 |
| Set the new orientation of the move primitive. | |
| virtual void | getGlobalPosition (UGlobalPosition &pos, uint8 worldImage) const =0 |
| Set the global position of the move primitive. | |
| virtual NLMISC::CVectorD | getFinalPosition (uint8 worldImage) const =0 |
| Get the position of the move primitive at the end of the movement. | |
| virtual const NLMISC::CVectorD & | getSpeed (uint8 worldImage) const =0 |
| Get the speed vector for this primitive. | |
Move the primitive. | |
| virtual void | insertInWorldImage (uint8 worldImage)=0 |
| Insert the primitive in a world image of the move container. | |
| virtual void | removeFromWorldImage (uint8 worldImage)=0 |
| Remove the primitive from a world image of the move container. | |
| virtual void | setGlobalPosition (const NLMISC::CVectorD &pos, uint8 worldImage, UGlobalPosition::TType type=UGlobalPosition::Unspecified)=0 |
| Set the global position of the move primitive. | |
| virtual void | setGlobalPosition (const UGlobalPosition &pos, uint8 worldImage)=0 |
| Set the global position of the move primitive. | |
| virtual void | move (const NLMISC::CVectorD &speed, uint8 worldImage)=0 |
| Move the primitive. | |
| virtual uint8 | getFirstWorldImageV () const =0 |
| Return the first world image. | |
| virtual uint8 | getNumWorldImageV () const =0 |
| Return the num of world image. | |
Public Attributes | |
| TUserData | UserData |
| User data. | |
Description of movables primitives.
This primitive can be a 2d oriented box or a 2d oriented cylinder.
Definition at line 50 of file u_move_primitive.h.
Type of the collision mask.
Definition at line 55 of file u_move_primitive.h.
Definition at line 56 of file u_move_primitive.h.
Reaction mode.
Definition at line 79 of file u_move_primitive.h.
Reaction mode.
Definition at line 103 of file u_move_primitive.h.
Primitive mode.
Definition at line 60 of file u_move_primitive.h.
| virtual NLPACS::UMovePrimitive::~UMovePrimitive | ( | ) | [inline, virtual] |
Definition at line 131 of file u_move_primitive.h.
| virtual float NLPACS::UMovePrimitive::getAbsorbtion | ( | ) | const [pure virtual] |
Set the attenuation of collision for this object.
Default value is 1. Should be between 0~1. 0, all the energy is attenuated by the collision. 1, all the energy stay in the object. Used only with the flag Reflexion.
| attenuation | is the new attenuation for the primitive. |
Implemented in NLPACS::CMovePrimitive.
Referenced by NLPACS::CMoveContainer::addCollisionablePrimitive(), and NLPACS::CMoveContainer::addNonCollisionablePrimitive().
| virtual TCollisionMask NLPACS::UMovePrimitive::getCollisionMask | ( | ) | const [pure virtual] |
Set the collision mask for this primitive.
Default mask is 0xffffffff.
| mask | is the new collision mask. |
Implemented in NLPACS::CMovePrimitive.
Referenced by NLPACS::CMoveContainer::addCollisionablePrimitive(), and NLPACS::CMoveContainer::addNonCollisionablePrimitive().
| virtual bool NLPACS::UMovePrimitive::getDontSnapToGround | ( | ) | const [pure virtual] |
Test if snapping to ground is off.
Implemented in NLPACS::CMovePrimitive.
| virtual NLMISC::CVectorD NLPACS::UMovePrimitive::getFinalPosition | ( | uint8 | worldImage | ) | const [pure virtual] |
Get the position of the move primitive at the end of the movement.
This method is slow. Just for initilisation and teleportation.
If you modify a noncollisionable primitive with this method, you must evaluate in the world image where you have modified it before modify any other dynamic properties in another world image.
Implemented in NLPACS::CMovePrimitive.
| virtual uint8 NLPACS::UMovePrimitive::getFirstWorldImageV | ( | ) | const [pure virtual] |
Return the first world image.
Implemented in NLPACS::CMovePrimitive.
| virtual void NLPACS::UMovePrimitive::getGlobalPosition | ( | UGlobalPosition & | pos, | |
| uint8 | worldImage | |||
| ) | const [pure virtual] |
Set the global position of the move primitive.
This method is fast because you must pass the global position of the primitive.
If you modify a noncollisionable primitive with this method, you must evaluate in the world image where you have modified it before modify any other dynamic properties in another world image.
| pos | is the new global position of the primitive. |
Implemented in NLPACS::CMovePrimitive.
| virtual float NLPACS::UMovePrimitive::getHeight | ( | ) | const [pure virtual] |
Set the height.
For boxes or cylinder.
| height | is the new height size of the box. It the size of the sides aligned on OZ. |
Implemented in NLPACS::CMovePrimitive.
Referenced by NLPACS::CMoveContainer::addCollisionablePrimitive(), and NLPACS::CMoveContainer::addNonCollisionablePrimitive().
| virtual uint8 NLPACS::UMovePrimitive::getNumWorldImageV | ( | ) | const [pure virtual] |
Return the num of world image.
Implemented in NLPACS::CMovePrimitive.
| virtual bool NLPACS::UMovePrimitive::getObstacle | ( | ) | const [pure virtual] |
Set the obstacle flag.
| obstacle | is true if this primitive is an obstacle, else false. |
Implemented in NLPACS::CMovePrimitive.
Referenced by NLPACS::CMoveContainer::addCollisionablePrimitive(), and NLPACS::CMoveContainer::addNonCollisionablePrimitive().
| virtual TCollisionMask NLPACS::UMovePrimitive::getOcclusionMask | ( | ) | const [pure virtual] |
Set the occlusion mask for this primitive.
Default mask is 0xffffffff.
| mask | is the new occlusion mask. |
Implemented in NLPACS::CMovePrimitive.
Referenced by NLPACS::CMoveContainer::addCollisionablePrimitive(), and NLPACS::CMoveContainer::addNonCollisionablePrimitive().
Set the new orientation of the move primitive.
Only for the box primitives.
If you modify a noncollisionable primitive with this method, you must evaluate in the world image where you have modified it before modify any other dynamic properties in another world image.
| rot | is the new OZ rotation in radian. | |
| worldImage | is the world image in which the primitive must be oriented. |
Implemented in NLPACS::CMovePrimitive.
| virtual TType NLPACS::UMovePrimitive::getPrimitiveType | ( | ) | const [pure virtual] |
Set the primitive type.
| type | is the new primitive type. |
Implemented in NLPACS::CMovePrimitive.
Referenced by NLPACS::CMoveContainer::addCollisionablePrimitive(), and NLPACS::CMoveContainer::addNonCollisionablePrimitive().
| virtual float NLPACS::UMovePrimitive::getRadius | ( | ) | const [pure virtual] |
Set the cylinder size.
Only for cylinder.
| radius | is the new radius size of the cylinder. |
Implemented in NLPACS::CMovePrimitive.
Referenced by NLPACS::CMoveContainer::addCollisionablePrimitive(), and NLPACS::CMoveContainer::addNonCollisionablePrimitive().
| virtual TReaction NLPACS::UMovePrimitive::getReactionType | ( | ) | const [pure virtual] |
Set the reaction type.
| type | is the new reaction type. |
Implemented in NLPACS::CMovePrimitive.
Referenced by NLPACS::CMoveContainer::addCollisionablePrimitive(), and NLPACS::CMoveContainer::addNonCollisionablePrimitive().
Set the box size.
Only for boxes.
| width | is the new width size of the box. It the size of the sides aligned on OX. | |
| depth | is the new depth size of the box. It the size of the sides aligned on OY. |
Implemented in NLPACS::CMovePrimitive.
Referenced by NLPACS::CMoveContainer::addCollisionablePrimitive(), and NLPACS::CMoveContainer::addNonCollisionablePrimitive().
| virtual const NLMISC::CVectorD& NLPACS::UMovePrimitive::getSpeed | ( | uint8 | worldImage | ) | const [pure virtual] |
Get the speed vector for this primitive.
the new speed vector.
Implemented in NLPACS::CMovePrimitive.
| virtual TTrigger NLPACS::UMovePrimitive::getTriggerType | ( | ) | const [pure virtual] |
Set the trigger type.
Default type is NotATrigger.
| type | is the new trigger type. |
Implemented in NLPACS::CMovePrimitive.
Referenced by NLPACS::CMoveContainer::addCollisionablePrimitive(), and NLPACS::CMoveContainer::addNonCollisionablePrimitive().
| virtual void NLPACS::UMovePrimitive::insertInWorldImage | ( | uint8 | worldImage | ) | [pure virtual] |
Insert the primitive in a world image of the move container.
This primitive must a collisionable primitive.
| worldImage | is the number of the world image where you want to insert the primitive. |
Implemented in NLPACS::CMovePrimitive.
Referenced by NLPACS::CMoveContainer::addCollisionnablePrimitiveBlock().
| virtual bool NLPACS::UMovePrimitive::isCollisionable | ( | ) | const [pure virtual] |
Return true if the primitive is collisionable.
Implemented in NLPACS::CMovePrimitive.
Referenced by NLPACS::CMoveContainer::evalNCPrimitiveCollision().
| virtual void NLPACS::UMovePrimitive::move | ( | const NLMISC::CVectorD & | speed, | |
| uint8 | worldImage | |||
| ) | [pure virtual] |
Move the primitive.
This method is fast. Use it to move primitives.
If you modify a noncollisionable primitive with this method, you must evaluate in the world image where you have modified it before modify any other dynamic properties in another world image.
| speed | is the speed of the primitive. |
Implemented in NLPACS::CMovePrimitive.
| virtual void NLPACS::UMovePrimitive::removeFromWorldImage | ( | uint8 | worldImage | ) | [pure virtual] |
Remove the primitive from a world image of the move container.
This primitive must a collisionable primitive.
| worldImage | is the number of the world image from where you want to remove the primitive. |
Implemented in NLPACS::CMovePrimitive.
| virtual void NLPACS::UMovePrimitive::setAbsorbtion | ( | float | attenuation | ) | [pure virtual] |
Set the attenuation of collision for this object.
Default value is 1. Should be between 0~1. 0, all the energy is attenuated by the collision. 1, all the energy stay in the object. Used only with the flag Reflexion.
| attenuation | is the new attenuation for the primitive. |
Implemented in NLPACS::CMovePrimitive.
Referenced by NLPACS::CMoveContainer::addCollisionnablePrimitiveBlock().
| virtual void NLPACS::UMovePrimitive::setCollisionMask | ( | TCollisionMask | mask | ) | [pure virtual] |
Set the collision mask for this primitive.
Default mask is 0xffffffff.
| mask | is the new collision mask. |
Implemented in NLPACS::CMovePrimitive.
Referenced by NLPACS::CMoveContainer::addCollisionnablePrimitiveBlock().
| virtual void NLPACS::UMovePrimitive::setDontSnapToGround | ( | bool | dont | ) | [pure virtual] |
Tells that the primitive should not be snapped to ground.
The default is false
Implemented in NLPACS::CMovePrimitive.
Referenced by NLPACS::CMoveContainer::addCollisionnablePrimitiveBlock().
| virtual void NLPACS::UMovePrimitive::setGlobalPosition | ( | const UGlobalPosition & | pos, | |
| uint8 | worldImage | |||
| ) | [pure virtual] |
Set the global position of the move primitive.
This method is fast because you must pass the global position of the primitive.
If you modify a noncollisionable primitive with this method, you must evaluate in the world image where you have modified it before modify any other dynamic properties in another world image.
| pos | is the new global position of the primitive. |
Implemented in NLPACS::CMovePrimitive.
| virtual void NLPACS::UMovePrimitive::setGlobalPosition | ( | const NLMISC::CVectorD & | pos, | |
| uint8 | worldImage, | |||
| UGlobalPosition::TType | type = UGlobalPosition::Unspecified | |||
| ) | [pure virtual] |
Set the global position of the move primitive.
Setting the global position can take a long time if you use a UGlobalRetriever. Set the position with this method only the first time or for teleporting.
If you modify a noncollisionable primitive with this method, you must evaluate in the world image where you have modified it before modify any other dynamic properties in another world image.
| pos | is the new global position of the primitive. |
Implemented in NLPACS::CMovePrimitive.
Referenced by NLPACS::CMoveContainer::addCollisionnablePrimitiveBlock().
| virtual void NLPACS::UMovePrimitive::setHeight | ( | float | height | ) | [pure virtual] |
Set the height.
For boxes or cylinder.
| height | is the new height size of the box. It the size of the sides aligned on OZ. |
Implemented in NLPACS::CMovePrimitive.
Referenced by NLPACS::CMoveContainer::addCollisionnablePrimitiveBlock().
| virtual void NLPACS::UMovePrimitive::setObstacle | ( | bool | obstacle | ) | [pure virtual] |
Set the obstacle flag.
| obstacle | is true if this primitive is an obstacle, else false. |
Implemented in NLPACS::CMovePrimitive.
Referenced by NLPACS::CMoveContainer::addCollisionnablePrimitiveBlock().
| virtual void NLPACS::UMovePrimitive::setOcclusionMask | ( | TCollisionMask | mask | ) | [pure virtual] |
Set the occlusion mask for this primitive.
Default mask is 0xffffffff.
| mask | is the new occlusion mask. |
Implemented in NLPACS::CMovePrimitive.
Referenced by NLPACS::CMoveContainer::addCollisionnablePrimitiveBlock().
Set the new orientation of the move primitive.
Only for the box primitives.
If you modify a noncollisionable primitive with this method, you must evaluate in the world image where you have modify it before modify any other dynamic properties in another world image.
| rot | is the new OZ rotation in radian. | |
| worldImage | is the world image in which the primitive must be oriented. |
Implemented in NLPACS::CMovePrimitive.
Referenced by NLPACS::CMoveContainer::addCollisionnablePrimitiveBlock().
| virtual void NLPACS::UMovePrimitive::setPrimitiveType | ( | TType | type | ) | [pure virtual] |
Set the primitive type.
| type | is the new primitive type. |
Implemented in NLPACS::CMovePrimitive.
Referenced by NLPACS::CMoveContainer::addCollisionnablePrimitiveBlock().
| virtual void NLPACS::UMovePrimitive::setRadius | ( | float | radius | ) | [pure virtual] |
Set the cylinder size.
Only for cylinder.
| radius | is the new radius size of the cylinder. |
Implemented in NLPACS::CMovePrimitive.
Referenced by NLPACS::CMoveContainer::addCollisionnablePrimitiveBlock().
| virtual void NLPACS::UMovePrimitive::setReactionType | ( | TReaction | type | ) | [pure virtual] |
Set the reaction type.
| type | is the new reaction type. |
Implemented in NLPACS::CMovePrimitive.
Referenced by NLPACS::CMoveContainer::addCollisionnablePrimitiveBlock().
Set the box size.
Only for boxes.
| width | is the new width size of the box. It the size of the sides aligned on OX. | |
| depth | is the new depth size of the box. It the size of the sides aligned on OY. |
Implemented in NLPACS::CMovePrimitive.
Referenced by NLPACS::CMoveContainer::addCollisionnablePrimitiveBlock().
| virtual void NLPACS::UMovePrimitive::setTriggerType | ( | TTrigger | type | ) | [pure virtual] |
Set the trigger type.
Default type is NotATrigger.
| type | is the new trigger type. |
Implemented in NLPACS::CMovePrimitive.
Referenced by NLPACS::CMoveContainer::addCollisionnablePrimitiveBlock().
User data.
Definition at line 129 of file u_move_primitive.h.
Referenced by NLPACS::CMoveContainer::addCollisionnablePrimitiveBlock(), and NLPACS::CMoveContainer::newTrigger().
1.6.1