Explorar el Código

Switched back to rebuilding matrices on Render

Ivan Safrin hace 12 años
padre
commit
9103d91b4a
Se han modificado 2 ficheros con 4 adiciones y 3 borrados
  1. 3 1
      Core/Contents/Source/PolyScene.cpp
  2. 1 2
      IDE/Contents/Source/PolycodeIDEApp.cpp

+ 3 - 1
Core/Contents/Source/PolyScene.cpp

@@ -132,7 +132,6 @@ bool Scene::isEnabled() {
 }
 }
 
 
 void Scene::Update() {
 void Scene::Update() {
-    rootEntity.updateEntityMatrix();
 	rootEntity.doUpdates();
 	rootEntity.doUpdates();
 }
 }
 
 
@@ -210,6 +209,8 @@ void Scene::Render(Camera *targetCamera) {
 	if(!targetCamera && !activeCamera)
 	if(!targetCamera && !activeCamera)
 		return;
 		return;
     
     
+    rootEntity.updateEntityMatrix();
+    
     renderer->setOverrideMaterial(overrideMaterial);
     renderer->setOverrideMaterial(overrideMaterial);
 	
 	
 	if(!targetCamera)
 	if(!targetCamera)
@@ -292,6 +293,7 @@ void Scene::Render(Camera *targetCamera) {
 
 
 void Scene::RenderDepthOnly(Camera *targetCamera) {
 void Scene::RenderDepthOnly(Camera *targetCamera) {
 	
 	
+    rootEntity.updateEntityMatrix();    
 	CoreServices::getInstance()->getRenderer()->cullFrontFaces(true);
 	CoreServices::getInstance()->getRenderer()->cullFrontFaces(true);
 
 
 	targetCamera->rebuildTransformMatrix();	
 	targetCamera->rebuildTransformMatrix();	

+ 1 - 2
IDE/Contents/Source/PolycodeIDEApp.cpp

@@ -1344,7 +1344,6 @@ PolycodeIDEApp::~PolycodeIDEApp() {
 
 
 bool PolycodeIDEApp::Update() {
 bool PolycodeIDEApp::Update() {
 
 
-	bool retVal = core->Update();
 
 
 	if(willRunProject) {
 	if(willRunProject) {
 		willRunProject = false;
 		willRunProject = false;
@@ -1390,7 +1389,7 @@ bool PolycodeIDEApp::Update() {
 		frame->getConsoleSizer()->enabled = false;		
 		frame->getConsoleSizer()->enabled = false;		
 	}
 	}
 
 
-
+	bool retVal = core->Update();
 	core->Render();
 	core->Render();
 	return retVal;
 	return retVal;
 }
 }