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/SkinnedSubMesh.cpp

Diff revisions: vs.
  @@ -19,11 +19,13 @@
19 19 Object3D::postLoad(sgn);
20 20 }
21 21
22 - void SkinnedSubMesh::sceneUpdate(const U32 sceneTime, SceneGraphNode* const sgn){
23 - if(_playAnimations) sgn->animationTransforms(_animator->GetTransforms(_deltaTime));
24 - else sgn->animationTransforms().clear();
22 + void SkinnedSubMesh::sceneUpdate(const U32 sceneTime, SceneGraphNode* const sgn, SceneState& sceneState){
23 + if(_playAnimations)
24 + sgn->animationTransforms(_animator->GetTransforms(_deltaTime));
25 + else
26 + sgn->animationTransforms().clear();
25 27
26 - Object3D::sceneUpdate(sceneTime,sgn);
28 + Object3D::sceneUpdate(sceneTime,sgn,sceneState);
27 29 }
28 30
29 31 /// Create a mesh animator from assimp imported data
  @@ -37,7 +39,7 @@
37 39 }
38 40
39 41 void SkinnedSubMesh::renderSkeleton(SceneGraphNode* const sgn){
40 - if(!_skeletonAvailable || !GET_ACTIVE_SCENE()->renderState()->drawSkeletons()) return;
42 + if(!_skeletonAvailable || !GET_ACTIVE_SCENE()->renderState().drawSkeletons()) return;
41 43 // update possible animation
42 44 assert(_animator != NULL);
43 45
  @@ -50,7 +52,8 @@
50 52 _skeletonAvailable = false;
51 53 _deltaTime = timeIndex;
52 54
53 - if(!_animator ||!GFX_DEVICE.isCurrentRenderStage(DISPLAY_STAGE)) return;
55 + if(!_animator ||!GFX_DEVICE.isCurrentRenderStage(DISPLAY_STAGE))
56 + return;
54 57
55 58 if(ParamHandler::getInstance().getParam<bool>("mesh.playAnimations")){
56 59 _playAnimations = dynamic_cast<SkinnedMesh*>(getParentMesh())->playAnimations();
  @@ -63,7 +66,8 @@
63 66 _skeletonAvailable = true;
64 67
65 68 ///Software skinning
66 - if(!_softwareSkinning) return;
69 + if(!_softwareSkinning)
70 + return;
67 71
68 72 if(_origVerts.empty()){
69 73 for(U32 i = 0; i < _geometry->getPosition().size(); i++){
  @@ -106,9 +110,18 @@
106 110 }
107 111
108 112 void SkinnedSubMesh::updateTransform(SceneGraphNode* const sgn){
109 - if(_animator != NULL && _playAnimations){
113 + Transform* transform = sgn->getTransform();
114 + //a submesh should always have a transform
115 + assert(transform);
116 + if(transform->isDirty() && _animator != NULL && _playAnimations){
110 117 _animator->setGlobalMatrix(sgn->getTransform()->getGlobalMatrix());
111 118 }
119 + transform = sgn->getParent()->getTransform();
120 + //a mesh should always have a transform
121 + assert(transform);
122 + //if(transform->isDirty()){
123 + sgn->updateBoundingBoxTransform(transform->getGlobalMatrix());
124 + //}
112 125 }
113 126
114 127 void SkinnedSubMesh::preFrameDrawEnd(SceneGraphNode* const sgn){