Lysa  0.0
Lysa 3D Engine
MeshInstance Class Reference

Detailed Description

Instance that holds a Mesh.

+ Inheritance diagram for MeshInstance:

Public Member Functions

 MeshInstance (const MeshInstance &orig)
 
 MeshInstance (const Mesh &mesh, const std::string &name="")
 
 MeshInstance (const MeshInstance &mi, const std::string &name)
 
const MeshgetMesh () const
 
bool isVisible () const
 
void setVisible (const bool visible)
 
bool isCastShadows () const
 
void setCastShadows (const bool castShadows)
 
const AABBgetAABB () const
 
void setAABB (const AABB &aabb)
 
const float4x4 & getTransform () const
 
void setTransform (const float4x4 &transform)
 
unique_id getSurfaceMaterial (uint32 surfaceIndex) const
 
void setSurfaceOverrideMaterial (const uint32 surfaceIndex, const unique_id materialId)
 
void removeSurfaceOverrideMaterial (const uint32 surfaceIndex)
 
unique_id getSurfaceOverrideMaterial (const uint32 surfaceIndex) const
 
MeshInstanceData getData () const
 
 ~MeshInstance () override
 
- Public Member Functions inherited from UniqueResource
 UniqueResource () = default
 
 UniqueResource (UniqueResource &) = delete
 
UniqueResource & operator= (UniqueResource &) = delete
 
- Public Member Functions inherited from UnmanagedResource
 UnmanagedResource ()
 
 UnmanagedResource (const Resource &other)
 
- Public Member Functions inherited from Resource
bool operator== (const Resource &other) const
 
 Resource () = default
 
 Resource (const unique_id id)
 
virtual ~Resource () = default
 

Additional Inherited Members

- Public Attributes inherited from Resource
unique_id id {INVALID_ID}
 

Constructor & Destructor Documentation

MeshInstance ( const MeshInstance &  orig)
MeshInstance ( const Mesh mesh,
const std::string &  name = "" 
)

Constructor

Parameters
meshReference to the mesh
nameOptional name for the instance
MeshInstance ( const MeshInstance &  mi,
const std::string &  name 
)
~MeshInstance ( )
override

Destructor

Member Function Documentation

const AABB& getAABB ( ) const
inline

Returns the world-space AABB of the instance

MeshInstanceData getData ( ) const

Returns the mesh instance data for GPU consumption

const Mesh& getMesh ( ) const
inline

Returns the mesh associated with the instance

unique_id getSurfaceMaterial ( uint32  surfaceIndex) const

Returns the material ID used by a specific surface

unique_id getSurfaceOverrideMaterial ( const uint32  surfaceIndex) const

Returns the override material ID for a specific surface

const float4x4& getTransform ( ) const
inline

Returns the world transformation matrix of the instance

bool isCastShadows ( ) const
inline

Returns true if the instance casts shadows

bool isVisible ( ) const
inline

Returns true if the instance is visible

void removeSurfaceOverrideMaterial ( const uint32  surfaceIndex)
inline

Removes the override material ID for a specific surface

void setAABB ( const AABB aabb)
inline

Sets the world-space AABB of the instance

void setCastShadows ( const bool  castShadows)
inline

Sets whether the instance casts shadows

void setSurfaceOverrideMaterial ( const uint32  surfaceIndex,
const unique_id  materialId 
)
inline

Sets an override material ID for a specific surface

void setTransform ( const float4x4 &  transform)
inline

Sets the world transformation matrix of the instance

void setVisible ( const bool  visible)
inline

Sets the visibility of the instance