Antkeeper  0.0.1
Public Member Functions | Static Public Attributes | List of all members
scene::object< T > Class Template Reference

Abstract base class for lights, cameras, model instances, and other scene objects. More...

#include <object.hpp>

Inheritance diagram for scene::object< T >:
scene::object_base

Public Member Functions

const std::size_t get_object_type_id () const noexcept final
 Returns the type ID for this scene object type. More...
 
- Public Member Functions inherited from scene::object_base
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...
 

Static Public Attributes

static const std::atomic< std::size_t > object_type_id {object_base::next_object_type_id()}
 Unique type ID for this scene object type. More...
 

Additional Inherited Members

- Public Types inherited from scene::object_base
using vector_type = math::fvec3
 
using quaternion_type = math::fquat
 
using transform_type = math::transform< float >
 
using aabb_type = geom::box< float >
 
- Protected Member Functions inherited from scene::object_base
virtual void transformed ()
 Called every time the scene object's tranform is changed. More...
 
- Static Protected Member Functions inherited from scene::object_base
static std::size_t next_object_type_id ()
 
- Protected Attributes inherited from scene::object_base
std::uint32_t m_layer_mask {1}
 
transform_type m_transform {transform_type::identity()}
 

Detailed Description

template<class T>
class scene::object< T >

Abstract base class for lights, cameras, model instances, and other scene objects.

Template Parameters
TThis should be the same class that's inheriting from the scene object, in order to give it a valid type-specific ID.

Definition at line 171 of file object.hpp.

Member Function Documentation

◆ get_object_type_id()

template<class T >
const std::size_t scene::object< T >::get_object_type_id ( ) const
inlinefinalvirtualnoexcept

Returns the type ID for this scene object type.

Implements scene::object_base.

Definition at line 177 of file object.hpp.

Member Data Documentation

◆ object_type_id

template<typename T >
const std::atomic< std::size_t > scene::object< T >::object_type_id {object_base::next_object_type_id()}
static

Unique type ID for this scene object type.

Definition at line 175 of file object.hpp.


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