Antkeeper
0.0.1
|
Abstract base class for scene objects. More...
#include <object.hpp>
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_type & | get_transform () const noexcept |
Returns the transform of the object. More... | |
constexpr const vector_type & | get_translation () const noexcept |
Returns the translation of the object. More... | |
constexpr const quaternion_type & | get_rotation () const noexcept |
Returns the rotation of the object. More... | |
constexpr const vector_type & | get_scale () const noexcept |
Returns the scale of the object. More... | |
virtual const aabb_type & | get_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()} |
Abstract base class for scene objects.
Definition at line 36 of file object.hpp.
using scene::object_base::aabb_type = geom::box<float> |
Definition at line 42 of file object.hpp.
Definition at line 40 of file object.hpp.
using scene::object_base::transform_type = math::transform<float> |
Definition at line 41 of file object.hpp.
Definition at line 39 of file object.hpp.
|
pure virtualnoexcept |
Returns the bounds of the object.
Implemented in scene::text, scene::static_mesh, scene::skeletal_mesh, scene::light, scene::light_probe, scene::camera, and scene::billboard.
|
inlineconstexprnoexcept |
Returns the layer mask of the object.
Definition at line 121 of file object.hpp.
|
pure virtualnoexcept |
Returns the type ID for this scene object type.
Implemented in scene::object< T >, scene::object< text >, scene::object< skeletal_mesh >, scene::object< light >, scene::object< camera >, scene::object< light_probe >, scene::object< billboard >, and scene::object< static_mesh >.
|
inlineconstexprnoexcept |
Returns the rotation of the object.
Definition at line 139 of file object.hpp.
|
inlineconstexprnoexcept |
Returns the scale of the object.
Definition at line 145 of file object.hpp.
|
inlineconstexprnoexcept |
Returns the transform of the object.
Definition at line 127 of file object.hpp.
|
inlineconstexprnoexcept |
Returns the translation of the object.
Definition at line 133 of file object.hpp.
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.
|
staticprotected |
Definition at line 24 of file object.cpp.
|
inlinevirtual |
Adds render operations to a render context.
ctx | Render context. |
Reimplemented in scene::text, scene::static_mesh, scene::skeletal_mesh, and scene::billboard.
Definition at line 52 of file object.hpp.
|
inlineconstexprnoexcept |
Sets the layer mask of the object.
mask | 32-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.
|
inline |
Sets the rotation of the object.
rotation | Object rotation. |
Definition at line 96 of file object.hpp.
|
inline |
Sets the scale of the object.
@params scale Object scale.
Definition at line 108 of file object.hpp.
|
inline |
Sets the scale of the object.
@params scale Object scale.
Definition at line 113 of file object.hpp.
|
inline |
Sets the transform of the object.
transform | Object transform. |
Definition at line 74 of file object.hpp.
|
inline |
Sets the translation of the object.
translation | Object translation. |
Definition at line 85 of file object.hpp.
|
inlineprotectedvirtual |
Called every time the scene object's tranform is changed.
Definition at line 159 of file object.hpp.
|
protected |
Definition at line 161 of file object.hpp.
|
protected |
Definition at line 162 of file object.hpp.