31Node::Node(
Model* model,
Node* parentNode,
const string&
id,
const string& name)
52 this->vertices.resize(
vertices.size());
55 this->vertices[i++] = vertex;
62 this->normals.resize(
normals.size());
65 this->normals[i++] = normal;
75 this->textureCoordinates[i++] = textureCoordinate;
81 this->tangents.resize(
tangents.size());
84 this->tangents[i++] = tangent;
93 this->bitangents[i++] = bitangent;
98 if (this->animation !=
nullptr && this->animation !=
animation)
delete this->
animation;
104 if (this->skinning !=
nullptr && this->skinning !=
skinning)
delete this->
skinning;
113 faceCount += facesEntity.getFaces().size();
120 if (facesEntity.getId() ==
id)
return &facesEntity;
130 this->facesEntities[i++] = facesEntity;
135 this->origins.resize(
origins.size());
138 this->origins[i++] = origin;
144 auto nodeIt =
subNodes.find(nodeId);
146 return nodeIt->second;
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
Node * getSubNodeById(const string &nodeId)
Returns a sub node by id.
FacesEntity * getFacesEntity(const string &id)
Find faces entity by id.
void setAnimation(Animation *animation)
Sets animation object.
void setTextureCoordinates(const vector< TextureCoordinate > &textureCoordinates)
Set texture coordinates.
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
map< string, Node * > subNodes
vector< Vector3 > tangents
vector< Vector3 > normals
Matrix4x4 transformationsMatrix
vector< Vector3 > origins
vector< Vector3 > vertices
vector< TextureCoordinate > textureCoordinates
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.
Class representing texture UV coordinates data.
Matrix4x4 & identity()
Setup identity matrix.