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

#include <SphereMesh.hpp>

Inheritance diagram for jop::SphereMesh:
jop::Mesh jop::Resource jop::SafeReferenceable< Resource > jop::SerializeInfo

Public Member Functions

 SphereMesh (const std::string &name)
 Constructor. More...
 
 SphereMesh (const SphereMesh &other, const std::string &newName)
 Copy constructor. More...
 
bool load (const float radius, const unsigned int rings, const bool normalizedTexCoords=true)
 Load this sphere. More...
 
float getRadius () const
 Get the radius. More...
 
unsigned int getRings () const
 Get the amount of rings. More...
 
unsigned int getSectors () const
 Get the amount of sectors. More...
 
bool normalizedTexCoords () const
 Check if this sphere uses normalized texture coordinates. More...
 
- Public Member Functions inherited from jop::Mesh
 Mesh (const std::string &name)
 Constructor. More...
 
 Mesh (const Mesh &other, const std::string &newName)
 Copy constructor. More...
 
bool load (const void *vertexData, const uint32 vertexBytes, const uint32 vertexComponents, const void *indexData=nullptr, const uint16 indexSize=0, const uint32 indexAmount=0)
 Load mesh from memory. More...
 
bool load (const std::vector< Vertex > &vertexArray, const std::vector< unsigned int > &indexArray)
 Load mesh from memory using default vertex format. More...
 
void draw () const
 Draw this mesh. More...
 
void destroy ()
 Destroy this mesh. More...
 
const std::pair< glm::vec3, glm::vec3 > & getBounds () const
 Get the bounds of this mesh. More...
 
unsigned int getVertexAmount () const
 Get the vertex amount. More...
 
uint16 getVertexSize () const
 Get the total vertex size. More...
 
void * getVertexOffset (const VertexComponent component) const
 Get the byte offset for the given component. More...
 
bool hasVertexComponent (const uint32 component) const
 Check if this mesh has a vertex component. More...
 
unsigned int getElementAmount () const
 Get the element (index) amount. More...
 
uint16 getElementSize () const
 Get the element size. More...
 
unsigned int getElementEnum () const
 Get the element type OpenGL enum. More...
 
const VertexBuffergetIndexBuffer () const
 Returns index buffer. More...
 
const VertexBuffergetVertexBuffer () const
 Returns vertex buffer. More...
 
void updateBounds (const glm::vec3 &min, const glm::vec3 &max)
 Manually update the bounds of this mesh. 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
 

Additional Inherited Members

- Public Types inherited from jop::Mesh
enum  VertexComponent : uint32 {
  Position = 1, TexCoords = 1 << 1, Normal = 1 << 2, Tangent = 1 << 3,
  BiTangent = 1 << 4, Color = 1 << 5
}
 
- Static Public Member Functions inherited from jop::Mesh
static uint16 getVertexSize (const uint32 components)
 Get the size of a vertex with the given format. More...
 
static MeshgetDefault ()
 Get the default mesh. 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...
 

Detailed Description

Definition at line 34 of file SphereMesh.hpp.

Constructor & Destructor Documentation

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

Constructor.

Does not initialize any vertices.

Parameters
nameName of the resource
jop::SphereMesh::SphereMesh ( const SphereMesh other,
const std::string &  newName 
)

Copy constructor.

Warning
A mesh on OpenGL ES 2.0 cannot be copied. The resulting copied mesh won't be valid.
Parameters
otherThe other mesh to be copied
newNameName of the new mesh

Member Function Documentation

float jop::SphereMesh::getRadius ( ) const

Get the radius.

Returns
The radius
unsigned int jop::SphereMesh::getRings ( ) const

Get the amount of rings.

Returns
The ring amount
unsigned int jop::SphereMesh::getSectors ( ) const

Get the amount of sectors.

Returns
The sector amount
bool jop::SphereMesh::load ( const float  radius,
const unsigned int  rings,
const bool  normalizedTexCoords = true 
)

Load this sphere.

Parameters
radiusThe radius of the sphere
ringsHow many rings will the sphere have
normalizedTexCoordsNormalize the texture coordinates?
Returns
True if successful
bool jop::SphereMesh::normalizedTexCoords ( ) const

Check if this sphere uses normalized texture coordinates.

Returns
True if normalized

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