NLPACS::UMovePrimitive Class Reference

Description of movables primitives. More...

#include <u_move_primitive.h>

Inherited by NLPACS::CMovePrimitive.

List of all members.

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::CVectorDgetSpeed (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.

Detailed Description

Description of movables primitives.

This primitive can be a 2d oriented box or a 2d oriented cylinder.

Author:
Cyril 'Hulud' Corvazier
Nevrax France
Date:
2001

Definition at line 50 of file u_move_primitive.h.


Member Typedef Documentation

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.


Member Enumeration Documentation

Reaction mode.

Enumerator:
DoNothing 

No reaction.

For static objects or not influenced objects. Default value.

Slide 

This object slides over surfaces.

Reflexion 

This object reflects over surfaces.

Stop 

This object stops over surfaces.

Definition at line 79 of file u_move_primitive.h.

Reaction mode.

Enumerator:
NotATrigger 

Not a trigger.

EnterTrigger 

This is a one time trigger.

This trigger is actived only when an object enter in its volume.

ExitTrigger 

This is a one time trigger.

This trigger is actived only when an object exit from its volume.

OverlapTrigger 

This is an overlap trigger.

This trigger is actived each time the object overlap the trigger.

Definition at line 103 of file u_move_primitive.h.

Primitive mode.

Enumerator:
_2DOrientedBox 

This is a static 2d oriented bounding box.

It can be oriented only on the Z axis. It has a height. Collision can be performed only on its sides but not on its top and bottom planes. It doesn't mode. Default value.

_2DOrientedCylinder 

This is a movable 2d oriented cylinder.

It can be oriented only on the Z axis. It has a height. Collision can be performed only on its sides but not on its top and bottom planes. It can move only with 3d translations.

Definition at line 60 of file u_move_primitive.h.


Constructor & Destructor Documentation

virtual NLPACS::UMovePrimitive::~UMovePrimitive (  )  [inline, virtual]

Definition at line 131 of file u_move_primitive.h.


Member Function Documentation

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.

Parameters:
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.

Parameters:
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.

Returns:
the new position of the primitive.

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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
mask is the new occlusion mask.

Implemented in NLPACS::CMovePrimitive.

Referenced by NLPACS::CMoveContainer::addCollisionablePrimitive(), and NLPACS::CMoveContainer::addNonCollisionablePrimitive().

virtual double NLPACS::UMovePrimitive::getOrientation ( uint8  worldImage  )  const [pure virtual]

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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
type is the new reaction type.

Implemented in NLPACS::CMovePrimitive.

Referenced by NLPACS::CMoveContainer::addCollisionablePrimitive(), and NLPACS::CMoveContainer::addNonCollisionablePrimitive().

virtual void NLPACS::UMovePrimitive::getSize ( float width,
float depth 
) const [pure virtual]

Set the box size.

Only for boxes.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
mask is the new occlusion mask.

Implemented in NLPACS::CMovePrimitive.

Referenced by NLPACS::CMoveContainer::addCollisionnablePrimitiveBlock().

virtual void NLPACS::UMovePrimitive::setOrientation ( double  rot,
uint8  worldImage 
) [pure virtual]

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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
type is the new reaction type.

Implemented in NLPACS::CMovePrimitive.

Referenced by NLPACS::CMoveContainer::addCollisionnablePrimitiveBlock().

virtual void NLPACS::UMovePrimitive::setSize ( float  width,
float  depth 
) [pure virtual]

Set the box size.

Only for boxes.

Parameters:
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.

Parameters:
type is the new trigger type.

Implemented in NLPACS::CMovePrimitive.

Referenced by NLPACS::CMoveContainer::addCollisionnablePrimitiveBlock().


Member Data Documentation


The documentation for this class was generated from the following file:

Generated on Thu Jan 7 08:30:21 2010 for NeL by  doxygen 1.6.1