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

#include <ConvexHullShape2D.hpp>

Inheritance diagram for jop::ConvexHullShape2D:
jop::CollisionShape2D jop::Resource jop::SafeReferenceable< Resource > jop::SerializeInfo

Public Member Functions

 ConvexHullShape2D (const std::string &name)
 Constructor. More...
 
bool load (const std::vector< glm::vec2 > &points)
 Load this shape. More...
 
bool load (const std::vector< glm::vec2 > &points, const std::vector< unsigned int > &indices)
 Load this shape using indexed points. More...
 
- Public Member Functions inherited from jop::CollisionShape2D
virtual ~CollisionShape2D () override=0
 Virtual destructor. 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
 

Static Public Member Functions

static ConvexHullShape2DgetDefault ()
 Get the default mesh shape. More...
 

Additional Inherited Members

- Protected Member Functions inherited from jop::CollisionShape2D
 CollisionShape2D (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 inherited from jop::CollisionShape2D
std::unique_ptr< b2Shape > m_shape
 Shape data. More...
 
bool m_isCompound
 

Detailed Description

Definition at line 35 of file ConvexHullShape2D.hpp.

Constructor & Destructor Documentation

jop::ConvexHullShape2D::ConvexHullShape2D ( const std::string &  name)

Constructor.

Parameters
nameName of the resource

Member Function Documentation

static ConvexHullShape2D& jop::ConvexHullShape2D::getDefault ( )
static

Get the default mesh shape.

Returns
Reference to the shape
bool jop::ConvexHullShape2D::load ( const std::vector< glm::vec2 > &  points)

Load this shape.

Parameters
pointsUnindexed vertices (triangles)
Returns
True if successful
bool jop::ConvexHullShape2D::load ( const std::vector< glm::vec2 > &  points,
const std::vector< unsigned int > &  indices 
)

Load this shape using indexed points.

Make sure that the indices are within the bounds of the vertex array. This function will not check for overflows.

Parameters
pointsIndexed vertices (triangles)
indicesIndices
Returns
True if successful

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