Base class for objects in the 3D scene. More...
#include <SceneObject.h>

Public Member Functions | |
| SceneObject (const std::string &name="SceneObject") | |
| Constructor with name. | |
| SceneObject (std::shared_ptr< Mesh > mesh, const std::string &name="SceneObject") | |
| Constructor with mesh. | |
| virtual | ~SceneObject ()=default |
| Virtual destructor. | |
| Transform & | GetTransform () |
| const Transform & | GetTransform () const |
| void | SetRelativePivot (const Vec3 &relativePivot) |
| Sets the relative pivot point where (0,0,0) represents the mesh center. | |
| Vec3 | GetRelativePivot () const |
| Gets the relative pivot point where (0,0,0) represents the mesh center. | |
| void | SetMesh (std::shared_ptr< Mesh > mesh) |
| std::shared_ptr< Mesh > | GetMesh () const |
| const std::string & | GetName () const |
| void | SetName (const std::string &name) |
| bool | IsVisible () const |
| void | SetVisible (bool visible) |
| bool | IsSelected () const |
| void | SetSelected (bool selected) |
| const Vec3 & | GetMaterialColor () const |
| void | SetMaterialColor (const Vec3 &color) |
| Mat4 | GetModelMatrix () const |
| Gets the model matrix for rendering. | |
| void | GetWorldBounds (Vec3 &minBounds, Vec3 &maxBounds) const |
| Gets the axis-aligned bounding box in world space. | |
| virtual void | Update (float deltaTime) |
| Virtual update method - can be overridden for custom behavior. | |
| virtual void | OnRender () |
| Virtual method called before rendering - can be overridden. | |
Protected Attributes | |
| std::string | m_Name |
| Transform | m_Transform |
| std::shared_ptr< Mesh > | m_Mesh |
| bool | m_Visible = true |
| bool | m_Selected = false |
| Vec3 | m_MaterialColor {1.0f, 1.0f, 1.0f} |
| Vec3 | m_RelativePivot {0.0f, 0.0f, 0.0f} |
Base class for objects in the 3D scene.
SceneObject represents any object that can be placed in the 3D scene. It contains a transform for positioning, rotation, and scaling, as well as a mesh for rendering. This serves as the base class for all scene objects.
|
explicit |
Constructor with name.
| name | The name of the scene object. |
| SceneObject::SceneObject | ( | std::shared_ptr< Mesh > | mesh, |
| const std::string & | name = "SceneObject" |
||
| ) |
Constructor with mesh.
| mesh | Shared pointer to the mesh. |
| name | The name of the scene object. |
|
virtualdefault |
Virtual destructor.
|
inline |
|
inline |
|
inline |
Gets the model matrix for rendering.
|
inline |
| Vec3 SceneObject::GetRelativePivot | ( | ) | const |
Gets the relative pivot point where (0,0,0) represents the mesh center.
|
inline |
|
inline |
Gets the axis-aligned bounding box in world space.
| minBounds | Output minimum bounds of the bounding box. |
| maxBounds | Output maximum bounds of the bounding box. |
|
inline |
|
inline |
|
inlinevirtual |
Virtual method called before rendering - can be overridden.
|
inline |
|
inline |
|
inline |
| void SceneObject::SetRelativePivot | ( | const Vec3 & | relativePivot | ) |
Sets the relative pivot point where (0,0,0) represents the mesh center.
| relativePivot | The pivot offset from mesh center. |
|
inline |
|
inline |
|
inlinevirtual |
Virtual update method - can be overridden for custom behavior.
| deltaTime | Time since last update in seconds. |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |