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

#include <CollisionShape.hpp>

Inheritance diagram for jop::CollisionShape:
jop::Resource jop::SafeReferenceable< Resource > jop::SerializeInfo jop::BoxShape jop::CapsuleShape jop::CompoundShape jop::ConeShape jop::ConvexHullShape jop::CylinderShape jop::InfinitePlaneShape jop::RectangleShape jop::SphereShape jop::TerrainShape

Public Member Functions

virtual ~CollisionShape () override=0
 Virtual destructor. More...
 
void setMargin (const float margin)
 Set the margin of this shape. More...
 
float getMargin () const
 Get the margin of this shape. More...
 
void setLocalScale (const glm::vec3 &scale)
 Set the local scaling. More...
 
glm::vec3 getLocalScale () const
 Get the current local scaling. More...
 
- Public Member Functions inherited from jop::Resource
 Resource (const std::string &name)
 Constructor. More...
 
virtual ~Resource ()=0
 Virtual destructor. More...
 
const std::string & getName () const
 Get the name of this resource. More...
 
void setPersistence (const unsigned short level)
 Set the persistence level. More...
 
unsigned short getPersistence () const
 Get the persistence level. More...
 
- Public Member Functions inherited from jop::SafeReferenceable< Resource >
WeakReference< ResourcegetReference () const
 Get a weak reference to the bound object. More...
 
- Public Member Functions inherited from jop::SerializeInfo
 SerializeInfo ()
 
void setSerializePackage (const uint16 package)
 
uint16 getSerializePackage () const
 
void setShouldSerialize (const bool set)
 
bool shouldSerialize () const
 
void setLightSerializeable (const bool set)
 
bool isLightSerializeable () const
 

Protected Member Functions

 CollisionShape (const std::string &name)
 Constructor. More...
 
- Protected Member Functions inherited from jop::Resource
 Resource (const Resource &other, const std::string &newName)
 Copy constructor. More...
 
- Protected Member Functions inherited from jop::SafeReferenceable< Resource >
 SafeReferenceable (Resource *ref)
 Constructor. More...
 
 SafeReferenceable (SafeReferenceable< Resource > &&other)
 Move constructor. More...
 
SafeReferenceableoperator= (SafeReferenceable< Resource > &&other)
 Move assignment operator. More...
 
 ~SafeReferenceable ()
 Protected destructor. More...
 

Protected Attributes

std::unique_ptr< btCollisionShape > m_shape
 Shape data. More...
 

Friends

class RigidBody
 
class PhantomBody
 
class CompoundShape
 
class Collider
 

Detailed Description

Definition at line 38 of file CollisionShape.hpp.

Constructor & Destructor Documentation

jop::CollisionShape::CollisionShape ( const std::string &  name)
protected

Constructor.

Parameters
nameName of the resource. This must be the file path if this resource is loaded from a file.
virtual jop::CollisionShape::~CollisionShape ( )
overridepure virtual

Virtual destructor.

Member Function Documentation

glm::vec3 jop::CollisionShape::getLocalScale ( ) const

Get the current local scaling.

Returns
The local scaling
float jop::CollisionShape::getMargin ( ) const

Get the margin of this shape.

Returns
The margin
void jop::CollisionShape::setLocalScale ( const glm::vec3 &  scale)

Set the local scaling.

This will scale the collision shape itself, but changes won't be seen in colliders until Collider::updateWorldBounds() is called on each one.

Parameters
Thenew scale to set
void jop::CollisionShape::setMargin ( const float  margin)

Set the margin of this shape.

Usually you can leave this at the default.

Parameters
marginThe margin to set

Friends And Related Function Documentation

friend class Collider
friend

Definition at line 47 of file CollisionShape.hpp.

friend class CompoundShape
friend

Definition at line 46 of file CollisionShape.hpp.

friend class PhantomBody
friend

Definition at line 45 of file CollisionShape.hpp.

friend class RigidBody
friend

Definition at line 44 of file CollisionShape.hpp.

Member Data Documentation

std::unique_ptr<btCollisionShape> jop::CollisionShape::m_shape
protected

Shape data.

Definition at line 94 of file CollisionShape.hpp.


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