#include <boxmesh.h>
Public Member Functions | |
BoxMesh (Core &core) | |
virtual bool | init (utility::ErrorState &errorState) override |
void | setup () |
virtual MeshInstance & | getMeshInstance () override |
virtual const MeshInstance & | getMeshInstance () const override |
const math::Box & | getBox () const |
![]() | |
Resource () | |
![]() | |
Object () | |
virtual | ~Object () |
virtual void | onDestroy () |
Object (Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object (Object &&)=delete | |
Object & | operator= (Object &&)=delete |
Public Attributes | |
glm::vec3 | mSize = { 1.0f, 1.0f, 1.0f } |
Property: 'Dimensions' of the box. More... | |
glm::vec3 | mPosition = { 0.0f, 0.0f, 0.0f } |
Property: 'Position' of the box. More... | |
RGBAColorFloat | mColor = { 1.0f, 1.0f, 1.0f, 1.0f } |
Property: 'Color' color of the box. More... | |
EMemoryUsage | mUsage = EMemoryUsage::Static |
Property: 'Usage' If the mesh is uploaded once or frequently updated. More... | |
ECullMode | mCullMode = ECullMode::Back |
Property: 'CullMode' controls which triangles are culled, back facing, front facing etc. More... | |
EPolygonMode | mPolygonMode = EPolygonMode::Fill |
Property: 'PolygonMode' Polygon rasterization mode (fill, line, points) More... | |
bool | mFlipNormals = false |
Property: 'FlipNormals' Whether to flip the box normals such that they point inwards. More... | |
![]() | |
std::string | mID |
Property: 'mID' unique name of the object. Used as an identifier by the system. More... | |
Protected Member Functions | |
void | constructBox (const math::Box &box, nap::MeshInstance &mesh) |
Additional Inherited Members | |
![]() | |
static bool | isIDProperty (rtti::Instance &object, const rtti::Property &property) |
Predefined box mesh with additional uv, color and normal vertex attributes. The UV coordinates are always 0-1. The box consists of 6 planes. The vertices of the individual planes are not shared.
|
protected |
Constructs the mesh based on the given dimensions
box | the box to build the mesh from |
mesh | the mesh that is constructed |
const math::Box& getBox | ( | ) | const |
|
overridevirtual |
Implements IMesh.
|
overridevirtual |
Implements IMesh.
|
overridevirtual |
Sets up and initializes the box as a mesh based on the provided parameters.
errorState | contains the error message if the mesh could not be created. |
Reimplemented from Object.
void setup | ( | ) |
Creates and prepares the mesh but doesn't initialize it. Call this when you want to prepare a box without creating the GPU representation. You have to manually call init() on the mesh instance afterwards.
RGBAColorFloat mColor = { 1.0f, 1.0f, 1.0f, 1.0f } |
Property: 'Color' color of the box.
ECullMode mCullMode = ECullMode::Back |
Property: 'CullMode' controls which triangles are culled, back facing, front facing etc.
bool mFlipNormals = false |
Property: 'FlipNormals' Whether to flip the box normals such that they point inwards.
EPolygonMode mPolygonMode = EPolygonMode::Fill |
Property: 'PolygonMode' Polygon rasterization mode (fill, line, points)
glm::vec3 mPosition = { 0.0f, 0.0f, 0.0f } |
Property: 'Position' of the box.
glm::vec3 mSize = { 1.0f, 1.0f, 1.0f } |
Property: 'Dimensions' of the box.
EMemoryUsage mUsage = EMemoryUsage::Static |
Property: 'Usage' If the mesh is uploaded once or frequently updated.