31 Node::Node(
Model* model,
Node* parentNode,
const string&
id,
const string& name)
50 this->vertices.resize(
vertices.size());
53 this->vertices[i++] = vertex;
60 this->normals.resize(
normals.size());
62 for (
const auto& normal:
normals) {
63 this->normals[i++] = normal;
73 this->textureCoordinates[i++] = textureCoordinate;
79 this->tangents.resize(
tangents.size());
81 for (
const auto& tangent:
tangents) {
82 this->tangents[i++] = tangent;
91 this->bitangents[i++] = bitangent;
96 this->animation = unique_ptr<Animation>(
animation);
101 this->skinning = unique_ptr<Skinning>(
skinning);
109 faceCount += facesEntity.getFaces().size();
116 if (facesEntity.getId() ==
id)
return &facesEntity;
126 this->facesEntities[i++] = facesEntity;
131 this->origins.resize(
origins.size());
133 for (
const auto& origin:
origins) {
134 this->origins[i++] = origin;
Represents a model face, consisting of vertex, normal, tangent and bitangent vectors,...
Node faces entity A node can have multiple entities containing faces and a applied material.
Representation of a 3D model.
void setHasSkinning(bool hasSkinning)
Set up if model has skinning.
int32_t getFaceCount() const
FacesEntity * getFacesEntity(const string &id)
Find faces entity by id.
void setAnimation(Animation *animation)
Sets animation object.
unique_ptr< Skinning > skinning
vector< Vector3 > bitangents
void setOrigins(const vector< Vector3 > &origins)
Set origins.
void setVertices(const vector< Vector3 > &vertices)
Set vertices.
void setFacesEntities(const vector< FacesEntity > &facesEntities)
Set up faces entities.
void setSkinning(Skinning *skinning)
Sets skinning object.
vector< FacesEntity > facesEntities
void setTextureCoordinates(const vector< Vector2 > &textureCoordinates)
Set texture coordinates.
Matrix4x4 transformMatrix
unique_ptr< Animation > animation
vector< Vector3 > tangents
vector< Vector2 > textureCoordinates
vector< Vector3 > normals
vector< Vector3 > origins
vector< Vector3 > vertices
void setNormals(const vector< Vector3 > &normals)
Set normals.
void setBitangents(const vector< Vector3 > &bitangents)
Set bitangents.
void setTangents(const vector< Vector3 > &tangents)
Set tangents.
Skinning definition for nodes.
Matrix4x4 class representing matrix4x4 mathematical structure and operations for 3d space.
Matrix4x4 & identity()
Creates identity matrix.
Vector2 class representing vector2 mathematical structure and operations with x, y components.
Vector3 class representing vector3 mathematical structure and operations with x, y,...