3#include "../Math/Transform.h"
4#include "../Math/Vec3.h"
25 explicit SceneObject(
const std::string &name =
"SceneObject");
32 SceneObject(std::shared_ptr<Mesh> mesh,
const std::string &name =
"SceneObject");
55 UpdatePivotFromMesh();
88 virtual void Update(
float deltaTime) { (void)deltaTime; }
99 void UpdatePivotFromMesh();
Base class for objects in the 3D scene.
Definition SceneObject.h:19
virtual ~SceneObject()=default
Virtual destructor.
std::shared_ptr< Mesh > m_Mesh
Definition SceneObject.h:104
bool IsSelected() const
Definition SceneObject.h:64
const Transform & GetTransform() const
Definition SceneObject.h:39
Vec3 m_RelativePivot
Definition SceneObject.h:110
bool IsVisible() const
Definition SceneObject.h:62
void SetVisible(bool visible)
Definition SceneObject.h:63
void SetMaterialColor(const Vec3 &color)
Definition SceneObject.h:69
std::shared_ptr< Mesh > GetMesh() const
Definition SceneObject.h:57
void SetName(const std::string &name)
Definition SceneObject.h:61
const Vec3 & GetMaterialColor() const
Definition SceneObject.h:68
void SetRelativePivot(const Vec3 &relativePivot)
Sets the relative pivot point where (0,0,0) represents the mesh center.
Definition SceneObject.cpp:80
Vec3 GetRelativePivot() const
Gets the relative pivot point where (0,0,0) represents the mesh center.
Definition SceneObject.cpp:86
Mat4 GetModelMatrix() const
Gets the model matrix for rendering.
Definition SceneObject.h:75
Transform & GetTransform()
Definition SceneObject.h:38
bool m_Visible
Definition SceneObject.h:105
virtual void OnRender()
Virtual method called before rendering - can be overridden.
Definition SceneObject.h:93
Transform m_Transform
Definition SceneObject.h:103
void GetWorldBounds(Vec3 &minBounds, Vec3 &maxBounds) const
Gets the axis-aligned bounding box in world space.
Definition SceneObject.cpp:18
bool m_Selected
Definition SceneObject.h:106
Vec3 m_MaterialColor
Definition SceneObject.h:108
std::string m_Name
Definition SceneObject.h:102
virtual void Update(float deltaTime)
Virtual update method - can be overridden for custom behavior.
Definition SceneObject.h:88
void SetMesh(std::shared_ptr< Mesh > mesh)
Definition SceneObject.h:52
void SetSelected(bool selected)
Definition SceneObject.h:65
const std::string & GetName() const
Definition SceneObject.h:60
4x4 Matrix structure for 3D transformations and projections.
Definition Mat4.h:16