Skip to content

Class ObjectID

ClassList > ObjectID

Base class for all scene graph objects with type and component access. More...

  • #include <ID.h>

Inherits the following classes: UID

Inherited by the following classes: Camera, DebugLine, DebugPoints, Empty, Environment, ImagePlane, Light, Mesh, PolygonLight, PostProcessing, SDFField, Sprite

Public Types

Type Name
enum GOType
Enumeration of scene object types.

Public Attributes

Type Name
bool is_rendered = true
Included in rendering pipeline.
bool is_viewport = true
Visible in viewport (editor-only)
std::string o_name
Display name in editor UI .
GOType o_type = NONE\_GO
Runtime type identifier.

Public Functions

Type Name
virtual void * GetMaterial ()
Returns pointer to object's material, if applicable.
virtual void * GetShader ()
Returns pointer to object's shader, if applicable.
virtual void * GetTransform ()
Returns pointer to object's transform, if applicable.
ObjectID ()
Constructs an ObjectID with default values.
void SetVisible (bool v, bool r)
Sets visibility flags for viewport and rendering.
~ObjectID ()
Destroys the ObjectID .

Public Functions inherited from UID

See UID

Type Name
int GetObjectID () const
Returns the unique ID of this object.
UID ()
Constructs a UID and assigns a unique ID.
virtual ~UID () = default
Virtual destructor for polymorphic use.

Public Static Functions inherited from UID

See UID

Type Name
int GetTotalAllocated ()
Returns total number of UIDs allocated.

Detailed Description

ObjectID extends UID with scene-specific functionality: * Object name for display in editor UI * Type enumeration for runtime type discrimination * Visibility flags for viewport and rendering * Polymorphic accessors for optional components (Transform, Shader, Material)

All scene objects inherit from ObjectID to participate in the scene graph. Type-specific data is stored in derived classes (Camera, Light, Mesh, etc.).

Note:

Ownership: ObjectID instances are typically owned by shared_ptr in scene containers.

Note:

Component pattern: Uses void* accessors for optional components to avoid circular dependencies.

Public Types Documentation

enum GOType

Enumeration of scene object types.

enum ObjectID::GOType {
    NONE_GO = -1,
    GO_CAM,
    GO_MESH,
    GO_LIGHT,
    GO_POLYLIGHT,
    GO_ENVIR,
    GO_SPRITE,
    GO_DL,
    GO_DP,
    GO_DM,
    GO_SDFFIELD
};

Used for runtime type identification without RTTI. Enables type-specific rendering paths and UI display.


Public Attributes Documentation

variable is_rendered

Included in rendering pipeline.

bool ObjectID::is_rendered;


variable is_viewport

Visible in viewport (editor-only)

bool ObjectID::is_viewport;


variable o_name

Display name in editor UI .

std::string ObjectID::o_name;


variable o_type

Runtime type identifier.

GOType ObjectID::o_type;


Public Functions Documentation

function GetMaterial

Returns pointer to object's material, if applicable.

inline virtual void * ObjectID::GetMaterial () 

Returns:

Void pointer cast to Material*, or nullptr if no material

Note:

Override in derived classes with Material component (Mesh)


function GetShader

Returns pointer to object's shader, if applicable.

inline virtual void * ObjectID::GetShader () 

Returns:

Void pointer cast to Shader*, or nullptr if no shader

Note:

Override in derived classes that own shaders (Mesh, Material, etc.)


function GetTransform

Returns pointer to object's transform, if applicable.

inline virtual void * ObjectID::GetTransform () 

Returns:

Void pointer cast to Transform*, or nullptr if no transform

Note:

Override in derived classes with Transform component (Camera, Light, Mesh)


function ObjectID

Constructs an ObjectID with default values.

ObjectID::ObjectID () 


function SetVisible

Sets visibility flags for viewport and rendering.

inline void ObjectID::SetVisible (
    bool v,
    bool r
) 

Parameters:

  • v Viewport visibility (editor display)
  • r Render visibility (included in render passes)

function ~ObjectID

Destroys the ObjectID .

ObjectID::~ObjectID () 



The documentation for this class was generated from the following file src/core/ID.h