Antkeeper  0.0.1
Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
scene::object_base Class Referenceabstract

Abstract base class for scene objects. More...

#include <object.hpp>

Inheritance diagram for scene::object_base:
scene::object< text > scene::object< skeletal_mesh > scene::object< light > scene::object< camera > scene::object< light_probe > scene::object< billboard > scene::object< static_mesh > scene::object< T >

Public Types

using vector_type = math::fvec3
 
using quaternion_type = math::fquat
 
using transform_type = math::transform< float >
 
using aabb_type = geom::box< float >
 

Public Member Functions

virtual const std::size_t get_object_type_id () const noexcept=0
 Returns the type ID for this scene object type. More...
 
virtual void render (render::context &ctx) const
 Adds render operations to a render context. More...
 
void look_at (const vector_type &position, const vector_type &target, const vector_type &up)
 
constexpr void set_layer_mask (std::uint32_t mask) noexcept
 Sets the layer mask of the object. More...
 
void set_transform (const transform_type &transform)
 Sets the transform of the object. More...
 
void set_translation (const vector_type &translation)
 Sets the translation of the object. More...
 
void set_rotation (const quaternion_type &rotation)
 Sets the rotation of the object. More...
 
constexpr std::uint32_t get_layer_mask () const noexcept
 Returns the layer mask of the object. More...
 
constexpr const transform_typeget_transform () const noexcept
 Returns the transform of the object. More...
 
constexpr const vector_typeget_translation () const noexcept
 Returns the translation of the object. More...
 
constexpr const quaternion_typeget_rotation () const noexcept
 Returns the rotation of the object. More...
 
constexpr const vector_typeget_scale () const noexcept
 Returns the scale of the object. More...
 
virtual const aabb_typeget_bounds () const noexcept=0
 Returns the bounds of the object. More...
 
void set_scale (const vector_type &scale)
 Sets the scale of the object. More...
 
void set_scale (float scale)
 Sets the scale of the object. More...
 

Protected Member Functions

virtual void transformed ()
 Called every time the scene object's tranform is changed. More...
 

Static Protected Member Functions

static std::size_t next_object_type_id ()
 

Protected Attributes

std::uint32_t m_layer_mask {1}
 
transform_type m_transform {transform_type::identity()}
 

Detailed Description

Abstract base class for scene objects.

Definition at line 36 of file object.hpp.

Member Typedef Documentation

◆ aabb_type

Definition at line 42 of file object.hpp.

◆ quaternion_type

Definition at line 40 of file object.hpp.

◆ transform_type

Definition at line 41 of file object.hpp.

◆ vector_type

Definition at line 39 of file object.hpp.

Member Function Documentation

◆ get_bounds()

virtual const aabb_type& scene::object_base::get_bounds ( ) const
pure virtualnoexcept

◆ get_layer_mask()

constexpr std::uint32_t scene::object_base::get_layer_mask ( ) const
inlineconstexprnoexcept

Returns the layer mask of the object.

Definition at line 121 of file object.hpp.

◆ get_object_type_id()

virtual const std::size_t scene::object_base::get_object_type_id ( ) const
pure virtualnoexcept

◆ get_rotation()

constexpr const quaternion_type& scene::object_base::get_rotation ( ) const
inlineconstexprnoexcept

Returns the rotation of the object.

Definition at line 139 of file object.hpp.

◆ get_scale()

constexpr const vector_type& scene::object_base::get_scale ( ) const
inlineconstexprnoexcept

Returns the scale of the object.

Definition at line 145 of file object.hpp.

◆ get_transform()

constexpr const transform_type& scene::object_base::get_transform ( ) const
inlineconstexprnoexcept

Returns the transform of the object.

Definition at line 127 of file object.hpp.

◆ get_translation()

constexpr const vector_type& scene::object_base::get_translation ( ) const
inlineconstexprnoexcept

Returns the translation of the object.

Definition at line 133 of file object.hpp.

◆ look_at()

void scene::object_base::look_at ( const vector_type position,
const vector_type target,
const vector_type up 
)

Definition at line 30 of file object.cpp.

◆ next_object_type_id()

std::size_t scene::object_base::next_object_type_id ( )
staticprotected

Definition at line 24 of file object.cpp.

◆ render()

virtual void scene::object_base::render ( render::context ctx) const
inlinevirtual

Adds render operations to a render context.

Parameters
ctxRender context.

Reimplemented in scene::text, scene::static_mesh, scene::skeletal_mesh, and scene::billboard.

Definition at line 52 of file object.hpp.

◆ set_layer_mask()

constexpr void scene::object_base::set_layer_mask ( std::uint32_t  mask)
inlineconstexprnoexcept

Sets the layer mask of the object.

Parameters
mask32-bit layer mask in which each set bit represents a layer in which the object is visible.

Definition at line 64 of file object.hpp.

◆ set_rotation()

void scene::object_base::set_rotation ( const quaternion_type rotation)
inline

Sets the rotation of the object.

Parameters
rotationObject rotation.

Definition at line 96 of file object.hpp.

◆ set_scale() [1/2]

void scene::object_base::set_scale ( const vector_type scale)
inline

Sets the scale of the object.

@params scale Object scale.

Definition at line 108 of file object.hpp.

◆ set_scale() [2/2]

void scene::object_base::set_scale ( float  scale)
inline

Sets the scale of the object.

@params scale Object scale.

Definition at line 113 of file object.hpp.

◆ set_transform()

void scene::object_base::set_transform ( const transform_type transform)
inline

Sets the transform of the object.

Parameters
transformObject transform.

Definition at line 74 of file object.hpp.

◆ set_translation()

void scene::object_base::set_translation ( const vector_type translation)
inline

Sets the translation of the object.

Parameters
translationObject translation.

Definition at line 85 of file object.hpp.

◆ transformed()

virtual void scene::object_base::transformed ( )
inlineprotectedvirtual

Called every time the scene object's tranform is changed.

Definition at line 159 of file object.hpp.

Member Data Documentation

◆ m_layer_mask

std::uint32_t scene::object_base::m_layer_mask {1}
protected

Definition at line 161 of file object.hpp.

◆ m_transform

transform_type scene::object_base::m_transform {transform_type::identity()}
protected

Definition at line 162 of file object.hpp.


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