PixelLightAPI
.
|
Abstract PL physics sensor base class. More...
#include <Sensor.h>
Classes | |
struct | BodyInfo |
Holds information about a detected body. More... | |
Public Types | |
enum | EFlags { ClosestBody = 1<<0 } |
Flags. More... | |
Public Member Functions | |
virtual PLPHYSICS_API | ~Sensor () |
Destructor. | |
PLPHYSICS_API PLCore::uint32 | GetFlags () const |
Returns the flags. | |
PLPHYSICS_API void | SetFlags (PLCore::uint32 nFlags=0) |
Sets the flags. | |
PLPHYSICS_API void | ClearHitList () |
Clears the list of hit bodies. | |
PLPHYSICS_API PLCore::uint32 | GetNumOfHitBodies () const |
Returns the number of hit physics bodies. | |
PLPHYSICS_API const BodyInfo * | GetHitBody (PLCore::uint32 nIndex) const |
Returns a hit physics body by index. | |
PLPHYSICS_API const BodyInfo * | GetClosestBody () const |
Returns the closest hit physics body. | |
virtual PLPHYSICS_API PLCore::uint32 | Check () |
Performs an immediate sensor check. | |
virtual PLPHYSICS_API bool | IsBody () const override |
Returns whether or not this is a body. | |
virtual PLPHYSICS_API bool | IsJoint () const override |
Returns whether or not this is a joint. | |
virtual PLPHYSICS_API bool | IsSensor () const override |
Returns whether or not this is a sensor. | |
Protected Member Functions | |
PLPHYSICS_API | Sensor (World &cWorld, PLCore::uint32 nFlags=0) |
Constructor. | |
PLPHYSICS_API BodyInfo & | GetFreeBodyInfo () |
Returns a free body information. | |
PLPHYSICS_API void | FreeBodyInfo (BodyInfo &cBodyInfo) |
Frees a body information. | |
virtual PLPHYSICS_API bool | Callback (Body &cBody, float fDistance, const PLMath::Vector3 &vNormal, int nCollisionID) |
Sensor callback function. |
Abstract PL physics sensor base class.
virtual PLPHYSICS_API PLPhysics::Sensor::~Sensor | ( | ) | [virtual] |
Destructor.
PLPHYSICS_API PLPhysics::Sensor::Sensor | ( | World & | cWorld, |
PLCore::uint32 | nFlags = 0 |
||
) | [protected] |
Constructor.
[in] | cWorld | World this sensor is in |
[in] | nFlags | Flags (see EFlags) |
PLPHYSICS_API PLCore::uint32 PLPhysics::Sensor::GetFlags | ( | ) | const |
Returns the flags.
PLPHYSICS_API void PLPhysics::Sensor::SetFlags | ( | PLCore::uint32 | nFlags = 0 | ) |
Sets the flags.
[in] | nFlags | Flags (see EFlags) |
PLPHYSICS_API void PLPhysics::Sensor::ClearHitList | ( | ) |
Clears the list of hit bodies.
PLPHYSICS_API PLCore::uint32 PLPhysics::Sensor::GetNumOfHitBodies | ( | ) | const |
Returns the number of hit physics bodies.
PLPHYSICS_API const BodyInfo* PLPhysics::Sensor::GetHitBody | ( | PLCore::uint32 | nIndex | ) | const |
Returns a hit physics body by index.
[in] | nIndex | Index of the hit physics body |
PLPHYSICS_API const BodyInfo* PLPhysics::Sensor::GetClosestBody | ( | ) | const |
Returns the closest hit physics body.
virtual PLPHYSICS_API PLCore::uint32 PLPhysics::Sensor::Check | ( | ) | [virtual] |
Performs an immediate sensor check.
virtual PLPHYSICS_API bool PLPhysics::Sensor::IsBody | ( | ) | const [override, virtual] |
Returns whether or not this is a body.
Implements PLPhysics::Element.
virtual PLPHYSICS_API bool PLPhysics::Sensor::IsJoint | ( | ) | const [override, virtual] |
Returns whether or not this is a joint.
Implements PLPhysics::Element.
virtual PLPHYSICS_API bool PLPhysics::Sensor::IsSensor | ( | ) | const [override, virtual] |
Returns whether or not this is a sensor.
Implements PLPhysics::Element.
PLPHYSICS_API BodyInfo& PLPhysics::Sensor::GetFreeBodyInfo | ( | ) | [protected] |
Returns a free body information.
PLPHYSICS_API void PLPhysics::Sensor::FreeBodyInfo | ( | BodyInfo & | cBodyInfo | ) | [protected] |
Frees a body information.
[in] | cBodyInfo | Body information to free |
virtual PLPHYSICS_API bool PLPhysics::Sensor::Callback | ( | Body & | cBody, |
float | fDistance, | ||
const PLMath::Vector3 & | vNormal, | ||
int | nCollisionID | ||
) | [protected, virtual] |
Sensor callback function.
[in] | cBody | Detected physics body |
[in] | fDistance | Distance |
[in] | vNormal | Hit normal |
[in] | nCollisionID | Collision ID |
|