Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 167 vs 168 for /trunk/Source Code/Geometry/Shapes/SubMesh.cpp

Diff revisions: vs.
  @@ -1,14 +1,19 @@
1 1 #include "Headers/SubMesh.h"
2 2 #include "Headers/Mesh.h"
3 +
3 4 #include "Core/Resources/Headers/ResourceCache.h"
5 + #include "Core/Math/Headers/Transform.h"
4 6 #include "Core/Headers/ParamHandler.h"
7 + #include "Graphs/Headers/SceneGraphNode.h"
5 8
6 9 SubMesh::~SubMesh(){
7 10 }
8 11
9 12 bool SubMesh::computeBoundingBox(SceneGraphNode* const sgn){
10 13 BoundingBox& bb = sgn->getBoundingBox();
11 - if(bb.isComputed()) return true;
14 + if(bb.isComputed())
15 + return true;
16 +
12 17 bb.set(getGeometryVBO()->getMinPosition(),getGeometryVBO()->getMaxPosition());
13 18 return SceneNode::computeBoundingBox(sgn);
14 19 }
  @@ -26,11 +31,17 @@
26 31 }
27 32
28 33 /// Called from SceneGraph "sceneUpdate"
29 - void SubMesh::sceneUpdate(const U32 sceneTime,SceneGraphNode* const sgn){
30 - Object3D::sceneUpdate(sceneTime, sgn);
34 + void SubMesh::sceneUpdate(const U32 sceneTime,SceneGraphNode* const sgn, SceneState& sceneState){
35 + Object3D::sceneUpdate(sceneTime, sgn,sceneState);
31 36 }
32 37
33 38 void SubMesh::updateTransform(SceneGraphNode* const sgn){
39 + Transform* parentTransform = sgn->getParent()->getTransform();
40 + //a mesh should always have a transform
41 + assert(parentTransform);
42 + if(parentTransform->isDirty()){
43 + sgn->updateBoundingBoxTransform(parentTransform->getGlobalMatrix());
44 + }
34 45 }
35 46
36 47 void SubMesh::updateBBatCurrentFrame(SceneGraphNode* const sgn){