102 auto nodeVerticesTransformed = &object3DNode->mesh->transformedVertices;
103 for (
auto& facesEntity : object3DNode->node->getFacesEntities())
104 for (
auto& face : facesEntity.getFaces()) {
105 auto faceVertexIndices = face.getVertexIndices();
108 (*nodeVerticesTransformed)[faceVertexIndices[0]],
109 (*nodeVerticesTransformed)[faceVertexIndices[1]],
110 (*nodeVerticesTransformed)[faceVertexIndices[2]]
117 auto nodeVerticesTransformed = &object3DNode->mesh->transformedVertices;
118 for (
auto& facesEntity : object3DNode->node->getFacesEntities())
119 for (
auto& face : facesEntity.getFaces()) {
120 auto faceVertexIndices = face.getVertexIndices();
123 (*nodeVerticesTransformed)[faceVertexIndices[0]],
124 (*nodeVerticesTransformed)[faceVertexIndices[1]],
125 (*nodeVerticesTransformed)[faceVertexIndices[2]]
144 if (object3DNode->node->getId() == nodeId) {
145 return object3DNode->mesh;
159 if (object3DNode->mesh ==
nullptr) {
160 vector<map<string, Matrix4x4*>*> instancesTransformationsMatrices;
161 vector<map<string, Matrix4x4*>*> instancesSkinningNodesMatrices;
162 for (
auto animation: object3DNode->object->instanceAnimations) {
163 instancesTransformationsMatrices.push_back(&animation->transformationsMatrices[0]);
164 instancesSkinningNodesMatrices.push_back(animation->getSkinningNodesMatrices(object3DNode->node));
167 object3DNode->mesh = meshManager->getMesh(object3DNode->id);
168 if (object3DNode->mesh ==
nullptr) {
170 object3DNode->renderer,
173 instancesTransformationsMatrices,
174 instancesSkinningNodesMatrices,
180 object3DNode->renderer,
183 instancesTransformationsMatrices,
184 instancesSkinningNodesMatrices,
199 object3DNode->renderer->dispose();
201 object3DNode->dispose();
204 meshManager->removeMesh(object3DNode->id);
206 delete object3DNode->mesh;
208 object3DNode->mesh =
nullptr;
static MeshManager * getMeshManager()
AnimationProcessingTarget
static Engine * getInstance()
Returns engine instance.
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.
Skinning definition for nodes.
Bounding volume interface.
Triangle entity, this is not directly connectable with physics engine.
Object3D animation class.
void getTriangles(vector< Triangle > &triangles, int nodeIdx=-1)
Retrieves list of triangles of all or given nodes.
virtual void initialize()
Initiates this object3d.
vector< Object3DNode * > object3dNodes
vector< bool > instanceEnabled
Engine::AnimationProcessingTarget animationProcessingTarget
vector< Transformations > instanceTransformations
vector< Object3DAnimation * > instanceAnimations
friend class Object3DBase_TransformedFacesIterator
virtual ~Object3DBase()
Destructor.
Object3DBase_TransformedFacesIterator * transformedFacesIterator
Object3DNodeMesh * getMesh(const string &nodeId)
Returns object3d node mesh object.
Object3DBase_TransformedFacesIterator * getTransformedFacesIterator()
virtual void dispose()
Disposes this object3d.
friend class Object3DNodeMesh
Object 3D node mesh specifically for rendering.
Object 3D node VBO renderer.
Object 3d node specifically for rendering.
static void createNodes(Object3DBase *object, bool useManagers, Engine::AnimationProcessingTarget animationProcessingTarget, vector< Object3DNode * > &object3DNodes)
Creates object 3d nodes from given object3d base object.
static void computeTransformations(int contextIdx, vector< Object3DNode * > &object3DNodes)
Applies transformations to meshes for given object 3d nodes.