3DRadSpace 0.1.0Alpha
3DRadSpace is a free, simple to use, rapid application development game engine.
Loading...
Searching...
No Matches
Engine3DRadSpace.Objects.IObject3D Class Referenceabstract

Polymorphic interface for 3D objects. More...

#include <IObject3D.hpp>

Inheritance diagram for Engine3DRadSpace.Objects.IObject3D:
Collaboration diagram for Engine3DRadSpace.Objects.IObject3D:

Public Member Functions

Matrix4x4 GetModelMatrix ()
float? Intersects (Ray ray)
virtual Math::Matrix4x4 GetModelMatrix () const
 Gets the world matrix of this object, considering the entire hierarchy of parent objects.
virtual Math::Matrix4x4 GetLocalMatrix () const
 Gets the local transformation matrix of this object, considering only its own position, rotation, and scale.
virtual float Intersects (const Math::Ray &r) const =0
 Returns the distance from the ray origin to the intersection point, or NaN if there is no intersection.
virtual Math::BoundingBox GetBoundingBox () const noexcept
 Gets the axis-aligned bounding box of this object in world space. Used for culling and intersections.
 ~IObject3D ()=default
Public Member Functions inherited from Engine3DRadSpace.Objects.IObject
void Enable ()
void Disable ()
bool Switch ()
void Show ()
void Hide ()
bool SwitchVisibility ()
IObject GetChild (int idx)
int GetChildrenCount ()
void InternalInitialize (IGame *game)
 Called by ObjectsList to set the _game Game instance. If there are objects manually managed, this MUST be called before Initialize or EditorInitialize.
virtual Reflection::UUID GetUUID () const noexcept=0
 Returns the unique identifier of this object. This is used for serialization and deserialization.
virtual Objects::Gizmos::IGizmo * GetGizmo () const noexcept=0
 Returns the gizmo object of this object, used for editor/debug rendering.
Graphics::IGraphicsDevice * GetGraphicsDeviceHandle () const noexcept
 Returns the graphics device handle associated with this object.
IGame * GetGame () const noexcept
 Gets the game that this object belongs to.
IObject * operator[] (size_t idxChild) const
 Returns the idx-th child of this object.
IObject * GetParent () const noexcept
 Returns the parent of this object.
void SetParent (IObject *newParent) noexcept
 Sets the parent of this object.
bool HasParent () const noexcept
 Checks if this object has a parent.
size_t GetChildrenCount () const noexcept
 Returns the number of children of this object.
virtual void Enable ()
 Enables this object.
virtual void Disable ()
 Disables this object.
virtual bool Switch ()
 Switched the enable/disable state of this object.
virtual void Show ()
 Shows this object.
virtual void Hide ()
 Hides this object.
virtual bool SwitchVisibility ()
 Switches the visibility state of this object.
void Uninitialize () override
 Called before the object has the destructor called.
virtual ~IObject ()
Public Member Functions inherited from Engine3DRadSpace.IInitializable
void Initialize ()
virtual void Initialize ()=0
 Initialization method.
virtual ~IInitializable ()=default
Public Member Functions inherited from Engine3DRadSpace.IUpdateable
void Update ()
virtual void Update ()=0
 Update function.
virtual ~IUpdateable ()=default
Public Member Functions inherited from Engine3DRadSpace.ILoadable
void Load ()
void Load (string path)
virtual void Load ()=0
 Loads object's assets.
virtual void Load (const std::filesystem::path &path)=0
 Reloads assets from another path. The initial underlying asset will not be replaced in the content manager.
virtual ~ILoadable ()=default
Public Member Functions inherited from Engine3DRadSpace.IDrawable3D
void Draw3D ()
virtual void Draw3D ()=0
 Main draw function for 3D objects.
virtual ~IDrawable3D ()=default

Public Attributes

Math::Vector3 Position
 Position in world space of this object.
Math::Vector3 RotationCenter
 Rotation pivot.
Math::Quaternion Rotation
 Rotation of this object. Default is (0,0,0,1) (identity quaternion).
Math::Vector3 Scale
 Scale of this object. Default is (1,1,1).
bool PostRender = false
 Forces a second draw pass after the main rendering passes completes.
Public Attributes inherited from Engine3DRadSpace.Objects.IObject
std::string Name
 Name of the object.
ChildObjectCollection Children
 Children of this object.

Protected Member Functions

 IObject3D (const std::string &name="", bool enabled=false, bool visible=false, const Math::Vector3 &pos=Math::Vector3::Zero(), const Math::Vector3 &pivot=Math::Vector3::Zero(), const Math::Quaternion &rotation=Math::Quaternion(), const Math::Vector3 &scale=Math::Vector3::One())
 IObject3D (const IObject3D &) noexcept=delete
IObject3D & operator= (const IObject3D &) noexcept=delete
 IObject3D (IObject3D &&) noexcept=default
IObject3D & operator= (IObject3D &&) noexcept=default
Protected Member Functions inherited from Engine3DRadSpace.Objects.IObject
 IObject (const std::string &name="Empty", bool enabled=false, bool visible=false)
 Default constructor used for reflection. Objects created with this constructor are initially invalid, until internalInitialize() is called.
 IObject (const IObject &) noexcept=delete
IObject & operator= (const IObject &) noexcept=delete
 IObject (IObject &&) noexcept=default
IObject & operator= (IObject &&) noexcept=default
Protected Member Functions inherited from Engine3DRadSpace.IInitializable
 IInitializable ()=default
 IInitializable (const IInitializable &) noexcept=default
IInitializable & operator= (const IInitializable &) noexcept=default
 IInitializable (IInitializable &&) noexcept=default
IInitializable & operator= (IInitializable &&) noexcept=default
Protected Member Functions inherited from Engine3DRadSpace.IUpdateable
 IUpdateable ()=default
 IUpdateable (const IUpdateable &) noexcept=default
IUpdateable & operator= (const IUpdateable &) noexcept=default
 IUpdateable (IUpdateable &&) noexcept=default
IUpdateable & operator= (IUpdateable &&) noexcept=default
Protected Member Functions inherited from Engine3DRadSpace.ILoadable
 ILoadable ()=default
 ILoadable (const ILoadable &) noexcept=default
ILoadable & operator= (const ILoadable &) noexcept=default
 ILoadable (ILoadable &&) noexcept=default
ILoadable & operator= (ILoadable &&) noexcept=default
Protected Member Functions inherited from Engine3DRadSpace.IDrawable3D
 IDrawable3D ()=default
 IDrawable3D (const IDrawable3D &)=default
IDrawable3D & operator= (const IDrawable3D &)=default
 IDrawable3D (IDrawable3D &&) noexcept=default
IDrawable3D & operator= (IDrawable3D &&) noexcept=default

Properties

Vector3 Position [get, set]
Vector3 RotationCenter [get, set]
Quaternion Rotation [get, set]
Vector3 Scale [get, set]
Properties inherited from Engine3DRadSpace.Objects.IObject
string Name [get, set]
bool Enabled [get, set]
 Is this object enabled?
bool Visible [get, set]
 Is this object visible?
Reflection.UUID UUID [get]
IGame Game [get]
IGraphicsDevice GraphicsDevice [get]
IGizmo Gizmo [get]
ObjectCollection Children [get]
IObject Parent [get, set]
Properties inherited from Engine3DRadSpace.IPtrWrapper
IntPtr Handle [get]

Additional Inherited Members

Protected Attributes inherited from Engine3DRadSpace.Objects.IObject
IGame * _game = nullptr
Graphics::IGraphicsDevice * _device = nullptr
IObject * _parent = nullptr

Detailed Description

Polymorphic interface for 3D objects.

Constructor & Destructor Documentation

◆ IObject3D() [1/3]

Engine3DRadSpace.Objects.IObject3D.IObject3D ( const std::string & name = "",
bool enabled = false,
bool visible = false,
const Math::Vector3 & pos = Math::Vector3::Zero(),
const Math::Vector3 & pivot = Math::Vector3::Zero(),
const Math::Quaternion & rotation = Math::Quaternion(),
const Math::Vector3 & scale = Math::Vector3::One() )
explicitprotected

◆ IObject3D() [2/3]

Engine3DRadSpace.Objects.IObject3D.IObject3D ( const IObject3D & )
protecteddeletenoexcept

◆ IObject3D() [3/3]

Engine3DRadSpace.Objects.IObject3D.IObject3D ( IObject3D && )
protecteddefaultnoexcept

◆ ~IObject3D()

Engine3DRadSpace.Objects.IObject3D.~IObject3D ( )
default

Member Function Documentation

◆ GetBoundingBox()

BoundingBox IObject3D::GetBoundingBox ( ) const
virtualnoexcept

Gets the axis-aligned bounding box of this object in world space. Used for culling and intersections.

Returns
Axis-aligned bounding box of this object

Reimplemented in Engine3DRadSpace.Objects.Skinmesh, Engine3DRadSpace.Objects::EventOnLocation, Engine3DRadSpace.Physics::Objects::RigidDynamic, and Engine3DRadSpace.Physics::Objects::RigidStatic.

◆ GetLocalMatrix()

Matrix4x4 IObject3D::GetLocalMatrix ( ) const
virtual

Gets the local transformation matrix of this object, considering only its own position, rotation, and scale.

Returns
Local transformation matrix of this object

Reimplemented in Engine3DRadSpace.Objects.Cone, Engine3DRadSpace.Objects.Cylinder, and Engine3DRadSpace.Objects.Sphere.

◆ GetModelMatrix() [1/2]

Matrix4x4 Engine3DRadSpace.Objects.IObject3D.GetModelMatrix ( )

◆ GetModelMatrix() [2/2]

Gets the world matrix of this object, considering the entire hierarchy of parent objects.

Returns
World matrix of this object

Reimplemented in Engine3DRadSpace.Objects.Camera.

◆ Intersects() [1/2]

float? Engine3DRadSpace.Objects.IObject3D.Intersects ( Ray ray)

◆ Intersects() [2/2]

virtual float Engine3DRadSpace.Objects.IObject3D.Intersects ( const Math::Ray & r) const
pure virtual

Returns the distance from the ray origin to the intersection point, or NaN if there is no intersection.

Parameters
rRay in world space
Returns
Distance from the ray origin to the intersection point, or NaN if there is no intersection

Implemented in Engine3DRadSpace.Objects.Box, Engine3DRadSpace.Objects.Camera, Engine3DRadSpace.Objects.Cone, Engine3DRadSpace.Objects.Cylinder, Engine3DRadSpace.Objects.Empty, Engine3DRadSpace.Objects.Skinmesh, Engine3DRadSpace.Objects.Skybox, Engine3DRadSpace.Objects.SoundSource, and Engine3DRadSpace.Objects.Sphere.

◆ operator=() [1/2]

IObject3D & Engine3DRadSpace.Objects.IObject3D.operator= ( const IObject3D & )
protecteddeletenoexcept

◆ operator=() [2/2]

IObject3D & Engine3DRadSpace.Objects.IObject3D.operator= ( IObject3D && )
protecteddefaultnoexcept

Member Data Documentation

◆ Position

Position in world space of this object.

◆ PostRender

bool Engine3DRadSpace.Objects.IObject3D.PostRender = false

Forces a second draw pass after the main rendering passes completes.

WARNING: If the object's Draw3D implementation uses RenderingManager before returning, those commands will not be executed since RenderingManager.Execute() runs after all initial Draw3D() calls complete.

◆ Rotation

Rotation of this object. Default is (0,0,0,1) (identity quaternion).

◆ RotationCenter

◆ Scale

Scale of this object. Default is (1,1,1).

Property Documentation

◆ Position

Vector3 Engine3DRadSpace.Objects.IObject3D.Position
getset

◆ Rotation

Quaternion Engine3DRadSpace.Objects.IObject3D.Rotation
getset

◆ RotationCenter

Vector3 Engine3DRadSpace.Objects.IObject3D.RotationCenter
getset

◆ Scale

Vector3 Engine3DRadSpace.Objects.IObject3D.Scale
getset

The documentation for this class was generated from the following files: