Represent a 3D textured object.
More...
#include <Object.hpp>
|
const Mesh * | _mesh = nullptr |
| Geometry of the object.
|
|
std::string | _materialName |
| Material name.
|
|
const Material * | _material = nullptr |
| Material.
|
|
std::vector< std::shared_ptr< Animation > > | _animations |
| Animations list (applied in order).
|
|
Animated< glm::mat4 > | _model { glm::mat4(1.0f) } |
| The transformation matrix of the 3D model, updated by the animations.
|
|
BoundingBox | _bbox |
| The world space object bounding box.
|
|
bool | _castShadow = true |
| Can the object casts shadows.
|
|
bool | _skipUVs = false |
| The object doesn't use UV coordinates.
|
|
bool | _dirtyBbox = true |
| Has the bounding box been updated following an animation update.
|
|
Represent a 3D textured object.
Inherited by Sky.
◆ Object() [1/4]
◆ Object() [2/4]
Object::Object |
( |
const Mesh * |
mesh, |
|
|
bool |
castShadows |
|
) |
| |
Construct a new object.
- Parameters
-
mesh | the geometric mesh infos |
castShadows | denote if the object should cast shadows |
◆ ~Object()
virtual Object::~Object |
( |
| ) |
|
|
virtualdefault |
◆ Object() [3/4]
Object::Object |
( |
const Object & |
| ) |
|
|
delete |
◆ Object() [4/4]
◆ addAnimation()
void Object::addAnimation |
( |
const std::shared_ptr< Animation > & |
anim | ) |
|
Add an animation to apply at each frame.
- Parameters
-
◆ animated()
bool Object::animated |
( |
| ) |
const |
|
inline |
Check if the object is moving over time.
- Returns
- a boolean denoting if animations are applied to the object
◆ boundingBox()
Query the bounding box of the object in world space.
- Returns
- the bounding box
- Note
- For mesh space bounding box, call boundingBox on mesh().
◆ castsShadow()
bool Object::castsShadow |
( |
| ) |
const |
|
inline |
Is the object casting a shadow.
- Returns
- a boolean denoting if the object is a caster
◆ decode()
Setup an object parameters from a list of key-value tuples. The following keywords will be searched for:
material: material_name
mesh: meshname
translation: X,Y,Z
scaling: scale
orientation: axisX,axisY,axisZ angle
shadows: bool
skipuvs: bool
animations:
- animationtype: ...
- ...
- Parameters
-
params | the parameters tuple |
options | data loading and storage options |
- Returns
- decoding status
Reimplemented in Sky.
◆ encode()
Generate a key-values representation of the object. See decode for the keywords and layout.
- Returns
- a tuple representing the object.
Reimplemented in Sky.
◆ material()
const Material & Object::material |
( |
| ) |
const |
|
inline |
- Returns
- the material associated to this object
◆ materialName()
const std::string & Object::materialName |
( |
| ) |
const |
|
inline |
- Returns
- the name of the material associated to this object
◆ mesh()
const Mesh * Object::mesh |
( |
| ) |
const |
|
inline |
Mesh getter.
- Returns
- the mesh infos
◆ model()
const glm::mat4 & Object::model |
( |
| ) |
const |
|
inline |
Object pose getter.
- Returns
- the model matrix
◆ operator=() [1/2]
Copy assignment.
- Returns
- a reference to the object assigned to
◆ operator=() [2/2]
Move assignment.
- Returns
- a reference to the object assigned to
◆ set()
void Object::set |
( |
const glm::mat4 & |
model | ) |
|
Update the object transformation matrix.
- Parameters
-
model | the new model matrix |
◆ setMaterial()
void Object::setMaterial |
( |
const Material * |
material | ) |
|
Set the material to use for this object
- Parameters
-
material | the new material to use |
◆ update()
void Object::update |
( |
double |
fullTime, |
|
|
double |
frameTime |
|
) |
| |
|
virtual |
Apply the animations for a frame duration.
- Parameters
-
fullTime | the time since the launch of the application |
frameTime | the time elapsed since the last frame |
Reimplemented in Sky.
◆ useTexCoords()
bool Object::useTexCoords |
( |
| ) |
const |
|
inline |
Should the object use its texture coordinates (if they exist)
- Returns
- a boolean denoting if the UV should be used
The documentation for this class was generated from the following files:
- src/engine/scene/Object.hpp
- src/engine/scene/Object.cpp