![]() |
Lysa
0.0
Lysa 3D Engine
|
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 Mesh & | getMesh () const |
| bool | isVisible () const |
| void | setVisible (bool visible) |
| bool | isCastShadows () const |
| void | setCastShadows (bool castShadows) |
| const AABB & | getAABB () const |
| void | setAABB (const AABB &aabb) |
| const float4x4 & | getTransform () const |
| void | setTransform (const float4x4 &transform) |
| unique_id | getSurfaceMaterial (uint32 surfaceIndex) const |
| void | setSurfaceOverrideMaterial (uint32 surfaceIndex, unique_id materialId) |
| void | removeSurfaceOverrideMaterial (uint32 surfaceIndex) |
| unique_id | getSurfaceOverrideMaterial (uint32 surfaceIndex) const |
| MeshInstanceData | getData () const |
| bool | isDirty () const |
| void | resetDirty () |
| void | setNodeData (void *data) |
| void * | getNodeData () 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} |
| MeshInstance | ( | const MeshInstance & | orig | ) |
Copy constructor — creates an independent instance sharing the same mesh.
| MeshInstance | ( | const Mesh & | mesh, |
| const std::string & | name = "" |
||
| ) |
Constructor
| mesh | Reference to the mesh |
| name | Optional name for the instance |
| MeshInstance | ( | const MeshInstance & | mi, |
| const std::string & | name | ||
| ) |
Copy constructor with a new name override.
|
override |
| MeshInstanceData getData | ( | ) | const |
Returns the mesh instance data for GPU consumption
|
inline |
Returns the mesh associated with the instance
|
inline |
Returns the material ID used by a specific surface
Returns the override material ID for a specific surface
|
inline |
Returns the world transformation matrix of the instance
|
inline |
Returns true if the instance casts shadows
|
inline |
Returns true if the instance data has changed and needs to be re-uploaded to the GPU.
|
inline |
Returns true if the instance is visible
| void removeSurfaceOverrideMaterial | ( | uint32 | surfaceIndex | ) |
Removes the override material ID for a specific surface
|
inline |
Clears the dirty flag after the instance data has been re-uploaded.
| void setCastShadows | ( | bool | castShadows | ) |
Sets whether the instance casts shadows
|
inline |
Sets an override material ID for a specific surface
| void setTransform | ( | const float4x4 & | transform | ) |
Sets the world transformation matrix of the instance
| void setVisible | ( | bool | visible | ) |
Sets the visibility of the instance