Antkeeper  0.0.1
Public Member Functions | List of all members
scene::skeletal_mesh Class Reference

#include <skeletal-mesh.hpp>

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

Public Member Functions

 skeletal_mesh (std::shared_ptr< render::model > model)
 Constructs a skeletal mesh from a model. More...
 
 skeletal_mesh ()=default
 Constructs a model instance. More...
 
void set_model (std::shared_ptr< render::model > model)
 Sets the model with which this model instance is associated. More...
 
void set_material (std::size_t index, std::shared_ptr< render::material > material)
 Overwrites the material of a model group for this model instance. More...
 
void reset_materials ()
 Resets all overwritten materials. More...
 
const aabb_typeget_bounds () const noexcept override
 Returns the bounds of the object. More...
 
const std::shared_ptr< render::model > & get_model () const noexcept
 Returns the model of the model instance. More...
 
void render (render::context &ctx) const override
 Adds render operations to a render context. More...
 
const skeletonget_skeleton () const noexcept
 Returns the skeleton of the skeletal mesh. More...
 
const animation_poseget_pose () const noexcept
 Returns the animation pose of the skeletal mesh. More...
 
animation_poseget_pose () noexcept
 Returns the animation pose of the skeletal mesh. More...
 
- Public Member Functions inherited from scene::object< skeletal_mesh >
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
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...
 
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...
 

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 >
 
- Static Public Attributes inherited from scene::object< skeletal_mesh >
static const std::atomic< std::size_t > object_type_id
 Unique type ID for this scene object type. 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

Definition at line 34 of file skeletal-mesh.hpp.

Constructor & Destructor Documentation

◆ skeletal_mesh() [1/2]

scene::skeletal_mesh::skeletal_mesh ( std::shared_ptr< render::model model)
explicit

Constructs a skeletal mesh from a model.

Parameters
modelModel from which the skeletal mesh will be constructed.

Definition at line 25 of file skeletal-mesh.cpp.

◆ skeletal_mesh() [2/2]

scene::skeletal_mesh::skeletal_mesh ( )
default

Constructs a model instance.

Member Function Documentation

◆ get_bounds()

const aabb_type& scene::skeletal_mesh::get_bounds ( ) const
inlineoverridevirtualnoexcept

Returns the bounds of the object.

Implements scene::object_base.

Definition at line 69 of file skeletal-mesh.hpp.

◆ get_model()

const std::shared_ptr<render::model>& scene::skeletal_mesh::get_model ( ) const
inlinenoexcept

Returns the model of the model instance.

Definition at line 77 of file skeletal-mesh.hpp.

◆ get_pose() [1/2]

const animation_pose& scene::skeletal_mesh::get_pose ( ) const
inlinenoexcept

Returns the animation pose of the skeletal mesh.

Definition at line 92 of file skeletal-mesh.hpp.

◆ get_pose() [2/2]

animation_pose& scene::skeletal_mesh::get_pose ( )
inlinenoexcept

Returns the animation pose of the skeletal mesh.

Definition at line 97 of file skeletal-mesh.hpp.

◆ get_skeleton()

const skeleton* scene::skeletal_mesh::get_skeleton ( ) const
inlinenoexcept

Returns the skeleton of the skeletal mesh.

Definition at line 85 of file skeletal-mesh.hpp.

◆ render()

void scene::skeletal_mesh::render ( render::context ctx) const
overridevirtual

Adds render operations to a render context.

Parameters
ctxRender context.

Reimplemented from scene::object_base.

Definition at line 117 of file skeletal-mesh.cpp.

◆ reset_materials()

void scene::skeletal_mesh::reset_materials ( )

Resets all overwritten materials.

Definition at line 78 of file skeletal-mesh.cpp.

◆ set_material()

void scene::skeletal_mesh::set_material ( std::size_t  index,
std::shared_ptr< render::material material 
)

Overwrites the material of a model group for this model instance.

Parameters
indexIndex of a model group.
materialPointer to the material which should overwrite the model group's material. A value of nullptr indicates the material will not be overwritten.

Definition at line 66 of file skeletal-mesh.cpp.

◆ set_model()

void scene::skeletal_mesh::set_model ( std::shared_ptr< render::model model)

Sets the model with which this model instance is associated.

Warning
This will reset all overwritten materials.

Definition at line 30 of file skeletal-mesh.cpp.


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