NAP
Public Member Functions | Public Attributes | Protected Attributes | List of all members
TorusMesh Class Reference

#include <torusmesh.h>

Public Member Functions

 TorusMesh (nap::Core &core)
 
virtual bool init (utility::ErrorState &errorState) override
 
bool setup (utility::ErrorState &errorState)
 
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
 

Public Attributes

float mRadius = 0.75f
 Property: 'Radius' torus radius. More...
 
float mTubeRadius = 0.25f
 Property: 'Height' tube segment radius. More...
 
uint mSegments = 64
 Property: 'Segments' number of segments. More...
 
uint mTubeSegments = 64
 Property: 'TubeSegments' number of tubular segments. More...
 
float mAngleOffset = 0.0f
 Property: 'AngleOffset' the angle offset in degrees. More...
 
EMemoryUsage mUsage = EMemoryUsage::Static
 Property: 'Usage' If the mesh is uploaded once or frequently updated. More...
 
EPolygonMode mPolygonMode = EPolygonMode::Fill
 Property: 'PolygonMode' the polygon mode. More...
 
ECullMode mCullMode = ECullMode::Back
 Property: 'CullMode' the cull mode. More...
 
RGBAColorFloat mColor = { 1.0f, 1.0f, 1.0f, 1.0f }
 Property: 'Color' Vertex color. More...
 
- Public Attributes inherited from Object
std::string mID
 Property: 'mID' unique name of the object. Used as an identifier by the system. More...
 

Protected Attributes

RenderServicemRenderService = nullptr
 
std::unique_ptr< MeshInstancemMeshInstance = nullptr
 

Additional Inherited Members

- Static Public Member Functions inherited from Object
static bool isIDProperty (rtti::Instance &object, const rtti::Property &property)
 

Description

Predefined torus mesh with additional normal, uv and color vertex attributes.

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

Constructor & Destructor Documentation

◆ TorusMesh()

TorusMesh ( nap::Core core)

Member Function Documentation

◆ getMeshInstance() [1/2]

virtual const MeshInstance& getMeshInstance ( ) const
overridevirtual
Returns
the mesh instance

Implements IMesh.

◆ getMeshInstance() [2/2]

virtual MeshInstance& getMeshInstance ( )
overridevirtual
Returns
the mesh instance

Implements IMesh.

◆ init()

virtual bool init ( utility::ErrorState errorState)
overridevirtual

Creates and initializes the mesh on the GPU.

Parameters
errorStatecontains the error if initialization fails.
Returns
if the component initialized successfully

Reimplemented from Object.

◆ setup()

bool setup ( utility::ErrorState errorState)

Creates the torus without GPU representation.

Parameters
errorStatecontains the error if initialization fails.

Member Data Documentation

◆ mAngleOffset

float mAngleOffset = 0.0f

Property: 'AngleOffset' the angle offset in degrees.

◆ mColor

RGBAColorFloat mColor = { 1.0f, 1.0f, 1.0f, 1.0f }

Property: 'Color' Vertex color.

◆ mCullMode

Property: 'CullMode' the cull mode.

◆ mMeshInstance

std::unique_ptr<MeshInstance> mMeshInstance = nullptr
protected

◆ mPolygonMode

Property: 'PolygonMode' the polygon mode.

◆ mRadius

float mRadius = 0.75f

Property: 'Radius' torus radius.

◆ mRenderService

RenderService* mRenderService = nullptr
protected

◆ mSegments

uint mSegments = 64

Property: 'Segments' number of segments.

◆ mTubeRadius

float mTubeRadius = 0.25f

Property: 'Height' tube segment radius.

◆ mTubeSegments

uint mTubeSegments = 64

Property: 'TubeSegments' number of tubular segments.

◆ mUsage

Property: 'Usage' If the mesh is uploaded once or frequently updated.