20 #ifndef ANTKEEPER_SCENE_OBJECT_HPP
21 #define ANTKEEPER_SCENE_OBJECT_HPP
183 template <
typename T>
Abstract base class for scene objects.
void set_transform(const transform_type &transform)
Sets the transform of the object.
virtual const aabb_type & get_bounds() const noexcept=0
Returns the bounds of the object.
static std::size_t next_object_type_id()
transform_type m_transform
constexpr std::uint32_t get_layer_mask() const noexcept
Returns the layer mask of the object.
virtual const std::size_t get_object_type_id() const noexcept=0
Returns the type ID for this scene object type.
constexpr const vector_type & get_translation() const noexcept
Returns the translation of the object.
void set_scale(const vector_type &scale)
Sets the scale of the object.
constexpr const vector_type & get_scale() const noexcept
Returns the scale of the object.
virtual void transformed()
Called every time the scene object's tranform is changed.
std::uint32_t m_layer_mask
constexpr void set_layer_mask(std::uint32_t mask) noexcept
Sets the layer mask of the object.
void set_rotation(const quaternion_type &rotation)
Sets the rotation of the object.
void set_scale(float scale)
Sets the scale of the object.
constexpr const quaternion_type & get_rotation() const noexcept
Returns the rotation of the object.
void look_at(const vector_type &position, const vector_type &target, const vector_type &up)
void set_translation(const vector_type &translation)
Sets the translation of the object.
constexpr const transform_type & get_transform() const noexcept
Returns the transform of the object.
Abstract base class for lights, cameras, model instances, and other scene objects.
static const std::atomic< std::size_t > object_type_id
Unique type ID for this scene object type.
const std::size_t get_object_type_id() const noexcept final
Returns the type ID for this scene object type.
quat< float > fquat
Quaternion with single-precision floating-point scalars.
quaternion< T > rotation(const vec3< T > &from, const vec3< T > &to, T tolerance=T{1e-6})
Constructs a quaternion representing the minimum rotation from one direction to another direction.
constexpr mat4< T > scale(const vec3< T > &v)
Constructs a scale matrix.
@ target
Vertex morph target (vec3)
@ position
Vertex position (vec3)
n-dimensional axis-aligned rectangle.
Quaternion composed of a real scalar part and imaginary vector part.