![]() |
Jopnal Engine
alpha 0.4
Simple Component Based 2D/3D Game Engine
|
#include <BoxMesh.hpp>
Public Member Functions | |
| BoxMesh (const std::string &name) | |
| Constructor. More... | |
| BoxMesh (const BoxMesh &other, const std::string &newName) | |
| Copy constructor. More... | |
| bool | load (const glm::vec3 &size) |
| Load this box. More... | |
| bool | load (const glm::vec3 &size, const glm::vec2 &min, const glm::vec2 &max) |
| Load this box with certain part of texture. More... | |
| bool | load (const glm::vec3 &size, const TextureAtlas &atlas, const unsigned int front, const unsigned int left, const unsigned int back, const unsigned int right, const unsigned int top, const unsigned int bottom) |
| Load from atlas with different texture for each face. More... | |
| bool | load (const glm::vec3 &size, const std::pair< glm::vec2, glm::vec2 > &front, const std::pair< glm::vec2, glm::vec2 > &left, const std::pair< glm::vec2, glm::vec2 > &back, const std::pair< glm::vec2, glm::vec2 > &right, const std::pair< glm::vec2, glm::vec2 > &top, const std::pair< glm::vec2, glm::vec2 > &bottom) |
| Load from atlas with different texture for each face. More... | |
| const glm::vec3 & | getSize () const |
| Get the size. 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 VertexBuffer & | getIndexBuffer () const |
| Returns index buffer. More... | |
| const VertexBuffer & | getVertexBuffer () 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< Resource > | getReference () 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 Mesh & | getDefault () |
| 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... | |
| SafeReferenceable & | operator= (SafeReferenceable< Resource > &&other) |
| Move assignment operator. More... | |
| ~SafeReferenceable () | |
| Protected destructor. More... | |
Definition at line 36 of file BoxMesh.hpp.
| jop::BoxMesh::BoxMesh | ( | const std::string & | name | ) |
Constructor.
Does not initialize any vertices.
| name | Name of the resource |
| jop::BoxMesh::BoxMesh | ( | const BoxMesh & | other, |
| const std::string & | newName | ||
| ) |
Copy constructor.
| other | The other mesh to be copied |
| newName | Name of the new mesh |
| const glm::vec3& jop::BoxMesh::getSize | ( | ) | const |
Get the size.
| bool jop::BoxMesh::load | ( | const glm::vec3 & | size | ) |
Load this box.
| size | Extents of the box |
| bool jop::BoxMesh::load | ( | const glm::vec3 & | size, |
| const glm::vec2 & | min, | ||
| const glm::vec2 & | max | ||
| ) |
Load this box with certain part of texture.
| size | Size of the box |
| min | Minimum bound of texture |
| max | Maximum bound of texture |
| bool jop::BoxMesh::load | ( | const glm::vec3 & | size, |
| const TextureAtlas & | atlas, | ||
| const unsigned int | front, | ||
| const unsigned int | left, | ||
| const unsigned int | back, | ||
| const unsigned int | right, | ||
| const unsigned int | top, | ||
| const unsigned int | bottom | ||
| ) |
Load from atlas with different texture for each face.
| size | Size of the box |
| atlas | Reference to the atlas |
| front | Index to the texture to be placed in to front face |
| left | Index to the texture to be placed in to left face |
| back | Index to the texture to be placed in to back face |
| right | Index to the texture to be placed in to right face |
| top | Index to the texture to be placed in to top face |
| bottom | Index to the texture to be placed in to bottom face |
| bool jop::BoxMesh::load | ( | const glm::vec3 & | size, |
| const std::pair< glm::vec2, glm::vec2 > & | front, | ||
| const std::pair< glm::vec2, glm::vec2 > & | left, | ||
| const std::pair< glm::vec2, glm::vec2 > & | back, | ||
| const std::pair< glm::vec2, glm::vec2 > & | right, | ||
| const std::pair< glm::vec2, glm::vec2 > & | top, | ||
| const std::pair< glm::vec2, glm::vec2 > & | bottom | ||
| ) |
Load from atlas with different texture for each face.
| size | Size of the box |
| front | Coordinates of the texture to be placed in front face |
| left | Coordinates of the texture to be placed in left face |
| back | Coordinates of the texture to be placed in back face |
| right | Coordinates of the texture to be placed in right face |
| top | Coordinates of the texture to be placed in top face |
| bottom | Coordinates of the texture to be placed in bottom face |
1.8.11