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

#include <boxframemesh.h>

Public Member Functions

 BoxFrameMesh (Core &core)
 
virtual bool init (utility::ErrorState &errorState) override
 
bool setup (const math::Box &box, utility::ErrorState &errorState)
 
virtual MeshInstancegetMeshInstance () override
 
virtual const MeshInstancegetMeshInstance () const override
 
const std::vector< glm::vec3 > & getUnitLineBox ()
 
const std::vector< glm::vec3 > & getNormalizedLineBox ()
 
- 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

EMemoryUsage mUsage = EMemoryUsage::Static
 Property: 'Usage' If the mesh is uploaded once or frequently updated. More...
 
bool mUnit = false
 Property: 'Extent' Extent of the box (0.5) 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 Member Functions

void setup ()
 

Protected Attributes

RenderServicemRenderService
 
std::unique_ptr< MeshInstancemMeshInstance
 

Additional Inherited Members

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

Description

Predefined box frame line mesh for objects to aid in visual debugging (e.g. nap::RenderFrustumComponent). Consists of a single position vertex attribute and is rendered as a line only using EPolygonMode::Line.

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

Constructor & Destructor Documentation

◆ BoxFrameMesh()

BoxFrameMesh ( Core core)

Member Function Documentation

◆ getMeshInstance() [1/2]

virtual const MeshInstance& getMeshInstance ( ) const
overridevirtual
Returns
the mesh instance that can be rendered to screen

Implements IMesh.

◆ getMeshInstance() [2/2]

virtual MeshInstance& getMeshInstance ( )
overridevirtual
Returns
the mesh instance that can be rendered to screen

Implements IMesh.

◆ getNormalizedLineBox()

const std::vector<glm::vec3>& getNormalizedLineBox ( )
Returns
the normalized line box from (-1, -1, -1) to (1, 1, 1)

◆ getUnitLineBox()

const std::vector<glm::vec3>& getUnitLineBox ( )
Returns
the unit line box from (-0.5, -0.5, -0.5) to (0.5, 0.5, 0.5)

◆ init()

virtual bool init ( utility::ErrorState errorState)
overridevirtual

Sets up and initializes the box 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() [1/2]

void setup ( )
protected

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.

◆ setup() [2/2]

bool setup ( const math::Box box,
utility::ErrorState errorState 
)

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.

Member Data Documentation

◆ mMeshInstance

std::unique_ptr<MeshInstance> mMeshInstance
protected

◆ mRenderService

RenderService* mRenderService
protected

◆ mUnit

bool mUnit = false

Property: 'Extent' Extent of the box (0.5)

◆ mUsage

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