5#ifndef NIRT_I_MESH_BUFFER_HPP_INCLUDED
6#define NIRT_I_MESH_BUFFER_HPP_INCLUDED
8#include <nirtcpp/core/engine/IReferenceCounted.hpp>
9#include <nirtcpp/core/engine/SMaterial.hpp>
10#include <nirtcpp/core/engine/aabbox3d.hpp>
11#include <nirtcpp/core/engine/S3DVertex.hpp>
12#include <nirtcpp/core/engine/SVertexIndex.hpp>
13#include <nirtcpp/core/engine/EHardwareBufferFlags.hpp>
14#include <nirtcpp/core/engine/EPrimitiveTypes.hpp>
15#include <nirtcpp/core/engine/EMeshBufferTypes.hpp>
135 virtual void append(
const void*
const vertices,
u32 numVertices,
const u16*
const indices,
u32 numIndices) = 0;
Base class of most objects of the Nirtcpp Engine.
Definition IReferenceCounted.hpp:46
Class for holding a mesh with a single material.
Definition IMeshBuffer.hpp:41
virtual video::SMaterial & getMaterial()=0
Get the material of this meshbuffer.
virtual const video::SMaterial & getMaterial() const =0
Get the material of this meshbuffer.
virtual E_HARDWARE_MAPPING getHardwareMappingHint_Vertex() const =0
get the current hardware mapping hint
virtual const core::vector3df & getNormal(u32 i) const =0
returns normal of vertex i
virtual const video::SColor & getColor(u32 i) const =0
returns color of vertex i
virtual u32 getChangedID_Index() const =0
Get the currently used ID for identification of changes.
virtual u32 getVertexCount() const =0
Get amount of vertices in meshbuffer.
virtual void recalculateBoundingBox()=0
Recalculates the bounding box. Should be called if the mesh changed.
virtual void setBoundingBox(const core::aabbox3df &box)=0
Set axis aligned bounding box.
virtual core::vector2df & getTCoords(u32 i)=0
returns texture coord of vertex i
virtual E_HARDWARE_MAPPING getHardwareMappingHint_Index() const =0
get the current hardware mapping hint
virtual u32 getPrimitiveCount() const
Calculate how many geometric primitives are used by this meshbuffer.
Definition IMeshBuffer.hpp:174
virtual const core::vector3df & getPosition(u32 i) const =0
returns position of vertex i
virtual const core::vector2df & getTCoords(u32 i) const =0
returns texture coord of vertex i
virtual u32 getChangedID_Vertex() const =0
Get the currently used ID for identification of changes.
virtual const core::aabbox3df & getBoundingBox() const =0
Get the axis aligned bounding box of this meshbuffer.
virtual video::E_VERTEX_TYPE getVertexType() const =0
Get type of vertex data which is stored in this meshbuffer.
virtual core::vector3df & getNormal(u32 i)=0
returns normal of vertex i
virtual IMeshBuffer * createClone(int cloneFlags=ECF_VERTICES|ECF_INDICES) const =0
Create a new object with a copy of the meshbuffer.
virtual u32 getIndexCount() const =0
Get amount of indices in this meshbuffer.
virtual void setHardwareMappingHint(E_HARDWARE_MAPPING newMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX)=0
set the hardware mapping hint, for driver
virtual const u16 * getIndices() const =0
Get access to indices.
virtual void * getVertices()=0
Get access to vertex data. The data is an array of vertices.
ECloneFlags
Bitflags with options for cloning.
Definition IMeshBuffer.hpp:203
@ ECF_INDICES
clone the vertices (or copy pointer for SSharedMeshBuffer)
Definition IMeshBuffer.hpp:205
virtual void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX)=0
flags the meshbuffer as changed, reloads hardware buffers
virtual u16 * getIndices()=0
Get access to indices.
virtual void append(const IMeshBuffer *const other)=0
virtual void setPrimitiveType(E_PRIMITIVE_TYPE type)=0
Describe what kind of primitive geometry is used by the meshbuffer.
virtual video::SColor & getColor(u32 i)=0
returns color of vertex i
virtual core::vector3df & getPosition(u32 i)=0
returns position of vertex i
virtual video::E_INDEX_TYPE getIndexType() const =0
Get type of index data which is stored in this meshbuffer.
virtual void append(const void *const vertices, u32 numVertices, const u16 *const indices, u32 numIndices)=0
Append the vertices and indices to the current buffer.
virtual E_PRIMITIVE_TYPE getPrimitiveType() const =0
Get the kind of primitive geometry which is used by the meshbuffer.
virtual const void * getVertices() const =0
Get access to vertex data. The data is an array of vertices.
virtual EMESH_BUFFER_TYPE getType() const
Returns type of the class implementing the IMeshBuffer.
Definition IMeshBuffer.hpp:196
Class representing a 32 bit ARGB color.
Definition SColor.hpp:317
Class for holding parameters for a material renderer.
Definition SMaterial.hpp:304
E_BUFFER_TYPE
Definition EHardwareBufferFlags.hpp:29
@ EBT_VERTEX_AND_INDEX
Change both vertex and index mapping to the same value.
Definition EHardwareBufferFlags.hpp:37
E_PRIMITIVE_TYPE
Enumeration for all primitive types there are.
Definition EPrimitiveTypes.hpp:15
@ EPT_TRIANGLES
Explicitly set all vertices for each triangle.
Definition EPrimitiveTypes.hpp:37
@ EPT_LINE_STRIP
All vertices form a single connected line.
Definition EPrimitiveTypes.hpp:20
@ EPT_LINES
Every two vertices are connected creating n/2 lines.
Definition EPrimitiveTypes.hpp:26
@ EPT_LINE_LOOP
Just as LINE_STRIP, but the last and the first vertex is also connected.
Definition EPrimitiveTypes.hpp:23
@ EPT_TRIANGLE_FAN
Definition EPrimitiveTypes.hpp:34
@ EPT_POINTS
All vertices are non-connected points.
Definition EPrimitiveTypes.hpp:17
@ EPT_POINT_SPRITES
The single vertices are expanded to quad billboards on the GPU.
Definition EPrimitiveTypes.hpp:54
@ EPT_QUADS
Definition EPrimitiveTypes.hpp:46
@ EPT_POLYGON
Definition EPrimitiveTypes.hpp:51
@ EPT_TRIANGLE_STRIP
Definition EPrimitiveTypes.hpp:30
@ EPT_QUAD_STRIP
Definition EPrimitiveTypes.hpp:41
E_HARDWARE_MAPPING
Definition EHardwareBufferFlags.hpp:14
EMESH_BUFFER_TYPE
An enumeration for all types of built-in mesh buffers.
Definition EMeshBufferTypes.hpp:18
@ EMBT_UNKNOWN
Unknown class type.
Definition EMeshBufferTypes.hpp:38
E_VERTEX_TYPE
Enumeration for all vertex types there are.
Definition S3DVertex.hpp:19
As of Nirtcpp 1.6, position2d is a synonym for vector2d.
Definition vector3d.hpp:11
unsigned short u16
16 bit unsigned variable.
Definition irrTypes.hpp:46
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.hpp:64