Freestyle: minor speedup by omitting unnecessary transform matrix operations in the file loader.

Previously the imported mesh data were transformed by a local-to-world projection matrix
through NodeTransform.  Now that the file loader assumes the imported mesh data already
in the camera coordinate system, an indentity matrix was supplied to NodeTransform.
The present commit avoids this redundant matrix operation by using NodeGroup instead of
NodeTransform, recalling the latter is a subclass of the former with extra matrix computations.
This commit is contained in:
Tamito Kajiyama 2014-05-19 11:10:11 +09:00
parent c32a671b3a
commit 54109add65
1 changed files with 1 additions and 5 deletions

View File

@ -449,7 +449,7 @@ void BlenderFileLoader::insertShapeNode(ObjectInstanceRen *obi, int id)
return;
// We allocate memory for the meshes to be imported
NodeTransform *currentMesh = new NodeTransform;
NodeGroup *currentMesh = new NodeGroup;
NodeShape *shape = new NodeShape;
unsigned vSize = 3 * 3 * numFaces;
@ -799,10 +799,6 @@ void BlenderFileLoader::insertShapeNode(ObjectInstanceRen *obi, int id)
rep->setBBox(bbox);
shape->AddRep(rep);
Matrix44r meshMat = Matrix44r::identity();
currentMesh->setMatrix(meshMat);
currentMesh->Translate(0, 0, 0);
currentMesh->AddChild(shape);
_Scene->AddChild(currentMesh);
}