GUInity
Public Member Functions | Protected Attributes | List of all members
Collider Class Referenceabstract

#include <Collider.hpp>

Inheritance diagram for Collider:
Component BoxCollider CapsuleCollider MeshCollider SphereCollider

Public Member Functions

 Collider ()
 
virtual ~Collider ()
 
void setTrigger (bool isTrigger)
 
bool getIsTrigger ()
 
void setQueryOnly (bool isQueryOnly)
 
bool getQueryOnly ()
 
virtual void init () override
 
virtual void destroy () override
 
virtual void awake () override
 
virtual void setActive (bool isActive) override
 
void setPhysicsMaterial (const shared_ptr< PhysicsMaterial > physMaterial)
 
shared_ptr< PhysicsMaterialgetPhysicsMaterial ()
 
virtual shared_ptr< Componentclone () override=0
 
virtual shared_ptr< ComponentDescriptiongetComponentDescription () override=0
 
virtual void deserialize (shared_ptr< ComponentDescription > desc) override=0
 
- Public Member Functions inherited from Component
 Component ()
 
virtual ~Component ()
 
virtual void tick (float deltaSecods)
 
shared_ptr< ActorgetActor ()
 
void setActor (weak_ptr< Actor > actor)
 

Protected Attributes

PxVec3 center
 
PxShape * shape
 
shared_ptr< PhysicsMaterialphysicsMaterial
 
bool isTrigger
 
bool isQueryOnly
 
- Protected Attributes inherited from Component
bool initWithData
 
bool isActive
 

Additional Inherited Members

- Protected Member Functions inherited from Component
void setCopyMode (bool initWithData)
 

Detailed Description

Collider is a component that adds either simulates real physics for an Actor or allows it to behave like a volume trigger. Collider is an abstract parent class for all the Collider types (SphereCollider, BoxCollider, CapsuleCollider and MeshCollider)

Constructor & Destructor Documentation

Collider::Collider ( )
inline

Default Constructor

virtual Collider::~Collider ( )
inlinevirtual

Default Destructor. Virtual because it's parent class

Member Function Documentation

virtual void Collider::awake ( )
inlineoverridevirtual

Component awake override

Reimplemented from Component.

virtual shared_ptr<Component> Collider::clone ( )
overridepure virtual

Pure virtual function. Clones current component (Prototype Design Pattern)

Returns
shared_ptr to cloned Collider Component

Implements Component.

Implemented in CapsuleCollider, SphereCollider, BoxCollider, and MeshCollider.

void Collider::destroy ( )
overridevirtual

Component destroy override

Reimplemented from Component.

bool Collider::getIsTrigger ( )

isTrigger getter

Returns
true if it's just a trigger, false if it physics simulated
shared_ptr< PhysicsMaterial > Collider::getPhysicsMaterial ( )

physicsMaterial getter

Returns
referente to PhysicsMaterial
bool Collider::getQueryOnly ( )

isQueryOnly getter

Returns
true if this object is only used in queries, false otherwise

isQueryOnly getter

Parameters
[in]queryOnlytrue if this object is only used in queries, false otherwise
void Collider::init ( )
overridevirtual

Component init override

Component Init override

Reimplemented from Component.

Reimplemented in CapsuleCollider, SphereCollider, BoxCollider, and MeshCollider.

void Collider::setActive ( bool  isActive)
overridevirtual

Component setActive override. Changes PhysX settings

Component setActive override

Reimplemented from Component.

void Collider::setPhysicsMaterial ( const shared_ptr< PhysicsMaterial physMaterial)

physicsMaterial getter

Parameters
[in]referenceto PhysicsMaterial
void Collider::setQueryOnly ( bool  isQueryOnly)

isQueryOnly getter

Parameters
[in]queryOnlytrue if this object is only used in queries, false otherwise

isQueryOnly getter

Returns
true if this object is only used in queries, false otherwise
void Collider::setTrigger ( bool  isTrigger)

isTrigger setter

Parameters
[in]isTrigger- true if it's just a trigger, false if it physics simulated

Member Data Documentation

PxVec3 Collider::center
protected

The center of the collider

bool Collider::isQueryOnly
protected

Is this collider used for queries only?

bool Collider::isTrigger
protected

Is this collider a trigger or should it simulate real world physics?

shared_ptr<PhysicsMaterial> Collider::physicsMaterial
protected

The physics material that determines the behaviour of the physics shape

PxShape* Collider::shape
protected

The PhysX Shape of the collider


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