NAP
Public Member Functions | List of all members
TriangleMesh Class Reference

#include <trianglemesh.h>

Public Member Functions

 TriangleMesh (Core &core)
 
virtual bool init (utility::ErrorState &errorState) override
 
bool setup (utility::ErrorState &error)
 
virtual MeshInstancegetMeshInstance () override
 
virtual const MeshInstancegetMeshInstance () const override
 
- Public Member Functions inherited from Resource
 Resource ()
 
- Public Member Functions inherited from Object
 Object ()
 
virtual ~Object ()
 
virtual void onDestroy ()
 
 Object (Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object (Object &&)=delete
 
Objectoperator= (Object &&)=delete
 

Additional Inherited Members

- Static Public Member Functions inherited from Object
static bool isIDProperty (rtti::Instance &object, const rtti::Property &property)
 
- Public Attributes inherited from Object
std::string mID
 Property: 'mID' unique name of the object. Used as an identifier by the system. More...
 

Description

Predefined rectangular mesh with a specific size centered at the origin on the xy axis. When there is no size given the mesh is a uniform 1m2. The UV coordinates are always 0-1 By default the plane has 1 row and 1 column

Inheritance diagram for TriangleMesh:
[legend]
Collaboration diagram for TriangleMesh:
[legend]

Constructor & Destructor Documentation

◆ TriangleMesh()

TriangleMesh ( Core core)

Member Function Documentation

◆ getMeshInstance() [1/2]

virtual const MeshInstance& getMeshInstance ( ) const
overridevirtual
Returns
the mesh used for rendering

Implements IMesh.

◆ getMeshInstance() [2/2]

virtual MeshInstance& getMeshInstance ( )
overridevirtual
Returns
the mesh used for rendering

Implements IMesh.

◆ init()

virtual bool init ( utility::ErrorState errorState)
overridevirtual

Sets up and initializes the plane as a mesh based on the provided parameters.

Parameters
errorStatecontains the error message if the mesh could not be created.
Returns
if the mesh was successfully created and initialized.

Reimplemented from Object.

◆ setup()

bool setup ( utility::ErrorState error)

Creates and prepares the mesh instance but doesn't initialize it. Call this when you want to prepare a grid without creating the GPU representation. You have to manually call init() on the mesh instance afterwards.

Parameters
errorcontains the error code if setup fails
Returns
if setup succeeded