Jopnal Engine  alpha 0.4
Simple Component Based 2D/3D Game Engine
Public Member Functions | Protected Member Functions | Friends | List of all members
jop::PhantomBody Class Reference

#include <PhantomBody.hpp>

Inheritance diagram for jop::PhantomBody:
jop::Collider jop::Component jop::SafeReferenceable< Collider > jop::CullerComponent jop::Drawable jop::AnimatedSprite jop::SkyBox jop::SkySphere jop::Sprite jop::Text jop::World jop::World2D

Public Member Functions

 PhantomBody (Object &object, World &world, CollisionShape &shape, const bool attachToWorld)
 Constructor. More...
 
virtual ~PhantomBody () override
 
void update (const float deltaTime) override
 Update function. More...
 
std::vector< Collider * > getOverlaps ()
 Get all the overlapping colliders. More...
 
std::vector< const Collider * > getOverlaps () const
 Get all the overlapping colliders. More...
 
unsigned int getOverlapAmount () const
 Get the number of overlapping colliders. More...
 
- Public Member Functions inherited from jop::Collider
bool checkOverlap (const Collider &other) const
 Check if this collider overlaps with another. More...
 
bool checkContact (const Collider &other) const
 Check if this collider is in contact with another. More...
 
bool checkRay (const glm::vec3 &start, const glm::vec3 &ray) const
 Check if a ray pierces this collider. More...
 
void registerListener (ContactListener &listener)
 Register a listener for this collider. More...
 
WorldgetWorld ()
 Get the world this collider belongs to. More...
 
const WorldgetWorld () const
 Get the world this collider belongs to. More...
 
void detachFromWorld ()
 Detach this body from its world. More...
 
void attachToWorld ()
 Attach this body to its world if it was previously detached. More...
 
bool isDetachedFromWorld () const
 Check if this body is currently detached from its world. More...
 
void updateWorldBounds ()
 Force update of the world space bounds. More...
 
void setCollisionShape (CollisionShape &shape)
 Set the collision shape. More...
 
const CollisionShapegetCollisionShape () const
 Get the collision shape. More...
 
- Public Member Functions inherited from jop::Component
virtual ~Component ()=0
 Virtual destructor. More...
 
Message::Result sendMessage (const Message &message)
 Send a message to this component. More...
 
uint32 getID () const
 Get the identifier. More...
 
void setID (const uint32 ID)
 Set the identifier. More...
 
WeakReference< ObjectgetObject ()
 Get the object this component is bound to. More...
 
WeakReference< const ObjectgetObject () const
 Get the object this component is bound to. More...
 
bool isActive () const
 Check if this component is active. More...
 
void removeSelf ()
 Remove this component from its object. More...
 
- Public Member Functions inherited from jop::SafeReferenceable< Collider >
WeakReference< CollidergetReference () const
 Get a weak reference to the bound object. More...
 

Protected Member Functions

 JOP_GENERIC_COMPONENT_CLONE (PhantomBody)
 
- Protected Member Functions inherited from jop::Collider
 Collider (Object &object, World &world, const uint32 ID)
 Constructor. More...
 
 Collider (const Collider &other, Object &newObj)
 Copy constructor. More...
 
virtual ~Collider () override=0
 Virtual destructor. More...
 
void setAllowSleep (const bool allow)
 Set whether the collider is allowed to sleep. More...
 
bool isSleepAllowed () const
 Check if sleep is allowed. More...
 
- Protected Member Functions inherited from jop::Component
 Component (Object &object, const uint32 ID)
 Constructor. More...
 
 Component (const Component &other, Object &newObj)
 Copy constructor. More...
 
virtual Message::Result receiveMessage (const Message &message)
 Receive a message. More...
 
- Protected Member Functions inherited from jop::SafeReferenceable< Collider >
 SafeReferenceable (Collider *ref)
 Constructor. More...
 
 SafeReferenceable (SafeReferenceable< Collider > &&other)
 Move constructor. More...
 
SafeReferenceableoperator= (SafeReferenceable< Collider > &&other)
 Move assignment operator. More...
 
 ~SafeReferenceable ()
 Protected destructor. More...
 

Friends

class CullerComponent
 

Additional Inherited Members

- Protected Attributes inherited from jop::Collider
std::unique_ptr< btCollisionObject > m_body
 Body data. More...
 
Worldm_worldRef
 Reference to the world. More...
 
std::set< ContactListener * > m_listeners
 Listeners registered for this collider. More...
 
bool m_detached
 Is this body detached from the world? More...
 
bool m_allowSleep
 Is sleep allowed? More...
 

Detailed Description

Definition at line 37 of file PhantomBody.hpp.

Constructor & Destructor Documentation

jop::PhantomBody::PhantomBody ( Object object,
World world,
CollisionShape shape,
const bool  attachToWorld 
)

Constructor.

Parameters
objectThe object to bind this component into
worldThe physics world
virtual jop::PhantomBody::~PhantomBody ( )
overridevirtual

Member Function Documentation

unsigned int jop::PhantomBody::getOverlapAmount ( ) const

Get the number of overlapping colliders.

Returns
The number of overlapping colliders
std::vector<Collider*> jop::PhantomBody::getOverlaps ( )

Get all the overlapping colliders.

Returns
The overlapping colliders
std::vector<const Collider*> jop::PhantomBody::getOverlaps ( ) const

Get all the overlapping colliders.

Returns
The overlapping colliders
jop::PhantomBody::JOP_GENERIC_COMPONENT_CLONE ( PhantomBody  )
protected
void jop::PhantomBody::update ( const float  deltaTime)
overridevirtual

Update function.

Parameters
deltaTimeThe delta time

Reimplemented from jop::Collider.

Reimplemented in jop::World, and jop::World2D.

Friends And Related Function Documentation

friend class CullerComponent
friend

Definition at line 43 of file PhantomBody.hpp.


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