5 #include <unordered_map>
17 using std::unique_ptr;
18 using std::unordered_map;
54 unordered_map<string, Node*>
nodes;
209 auto nodeIt =
nodes.find(
id);
210 if (nodeIt !=
nodes.end()) {
211 return nodeIt->second;
232 return nodeIt->second;
277 return animationSetupIt->second;
404 this->embedSpecularTextures = embedTextures;
419 this->embedPBRTextures = embedTextures;
Representation of a 3D model.
const vector< string > getMaterialIds()
unordered_map< string, Node * > & getSubNodes()
Returns object's sub nodes.
unordered_map< string, Material * > & getMaterials()
Returns all object materials.
void setImportTransformMatrix(const Matrix4x4 &importTransformMatrix)
Set import transform matrix.
bool computeTransformMatrix(const string &nodeId, Matrix4x4 &transformMatrix, int32_t frame=0)
Computes a transform matrix at a given frame for a given node id recursivly.
void clearAnimationSetups()
Clear animation setups.
RotationOrder * getRotationOrder()
AuthoringTool authoringTool
bool hasEmbeddedPBRTextures() const
AnimationSetup * getAnimationSetup(const string &id)
unordered_map< string, Node * > nodes
void setShaderModel(ShaderModel *shaderModel)
Set preferred shader model.
void invalidateBoundingBox()
Invalidates bounding box.
AuthoringTool getAuthoringTool()
bool removeAnimationSetup(const string &id)
Remove animation setup.
unordered_map< string, Node * > subNodes
RotationOrder * rotationOrder
static STATIC_DLL_IMPEXT string ANIMATIONSETUP_DEFAULT
const Matrix4x4 & getImportTransformMatrix()
static constexpr STATIC_DLL_IMPEXT float FPS_DEFAULT
void setUpVector(UpVector *upVector)
Set up vector.
unordered_map< string, Node * > & getNodes()
Returns all object's nodes.
void setHasSkinning(bool hasSkinning)
Set up if model has skinning.
ShaderModel * getShaderModel()
bool hasBoundingBoxUpdate()
void setEmbedPBRTextures(bool embedTextures)
Set if to embed PBR textures.
void setEmbedSpecularTextures(bool embedTextures)
Set if to embed specular textures.
Model(const string &id, const string &name, UpVector *upVector, RotationOrder *rotationOrder, BoundingBox *boundingBox, AuthoringTool authoringTool=AUTHORINGTOOL_UNKNOWN)
Public constructor.
Node * getSubNodeById(const string &id)
Returns a sub node by given name or null.
static STATIC_DLL_IMPEXT uint32_t uidCounter
const vector< string > getNodeIds()
Returns all object's node ids.
AnimationSetup * addAnimationSetup(const string &id, int32_t startFrame, int32_t endFrame, bool loop, float speed=1.0f)
Adds an base animation setup.
AnimationSetup * addOverlayAnimationSetup(const string &id, const string &overlayFromNodeId, int32_t startFrame, int32_t endFrame, bool loop, float speed=1.0f)
Adds an overlay animation setup.
bool hasEmbeddedSpecularTextures() const
ShaderModel * shaderModel
unordered_map< string, Material * > materials
unique_ptr< BoundingBox > boundingBox
void deleteSubNodes(const unordered_map< string, Node * > &subNodes)
Delete sub nodes.
bool computeTransformMatrix(const unordered_map< string, Node * > &nodes, const Matrix4x4 &parentTransformMatrix, int32_t frame, const string &nodeId, Matrix4x4 &transformMatrix)
Computes a transform matrix at a given frame for a given node id recursivly.
const vector< string > getAnimationSetupIds()
const unordered_map< string, AnimationSetup * > & getAnimationSetups()
bool renameAnimationSetup(const string &id, const string &newId)
Rename animation set up.
bool embedSpecularTextures
BoundingBox * getBoundingBox()
bool computeTransformMatrix(const string &nodeId, const Matrix4x4 &parentTransformMatrix, Matrix4x4 &transformMatrix, int32_t frame=-1)
Computes a transform matrix at a given frame for a given node id recursivly.
Matrix4x4 importTransformMatrix
unordered_map< string, AnimationSetup * > animationSetups
void setFPS(float fps)
Set model animation frames per seconds.
Node * getNodeById(const string &id)
Returns a node by given name or null.
Represents rotation orders of a model.
Axis aligned bounding box used for frustum, this is not directly connectable with physics engine.
Matrix4x4 class representing matrix4x4 mathematical structure and operations for 3d space.
#define STATIC_DLL_IMPEXT
#define FORBID_CLASS_COPY(CLASS)