فهرست منبع

Fixing invalid rotation on FBX import

BearishSun 9 سال پیش
والد
کامیت
cb0c2ba6da
2فایلهای تغییر یافته به همراه6 افزوده شده و 6 حذف شده
  1. 1 1
      Source/BansheeFBXImporter/Source/BsFBXImporter.cpp
  2. 5 5
      Source/ExampleProject/Source/Main.cpp

+ 1 - 1
Source/BansheeFBXImporter/Source/BsFBXImporter.cpp

@@ -593,7 +593,7 @@ namespace bs
 		Vector3 rotationEuler = FBXToNativeType(fbxNode->LclRotation.Get());
 		Vector3 rotationEuler = FBXToNativeType(fbxNode->LclRotation.Get());
 		Vector3 scale = FBXToNativeType(fbxNode->LclScaling.Get());
 		Vector3 scale = FBXToNativeType(fbxNode->LclScaling.Get());
 
 
-		Quaternion rotation((Radian)rotationEuler.x, (Radian)rotationEuler.y, (Radian)rotationEuler.z);
+		Quaternion rotation((Degree)rotationEuler.x, (Degree)rotationEuler.y, (Degree)rotationEuler.z);
 
 
 		node->localTransform.setTRS(translation, rotation, scale);
 		node->localTransform.setTRS(translation, rotation, scale);
 		node->name = fbxNode->GetNameWithoutNameSpacePrefix().Buffer();
 		node->name = fbxNode->GetNameWithoutNameSpacePrefix().Buffer();

+ 5 - 5
Source/ExampleProject/Source/Main.cpp

@@ -148,7 +148,7 @@ namespace bs
 		HMaterial exampleMaterial = createMaterial(exampleTexture, exampleShader);
 		HMaterial exampleMaterial = createMaterial(exampleTexture, exampleShader);
 
 
 		setUp3DScene(exampleModel, exampleMaterial);
 		setUp3DScene(exampleModel, exampleMaterial);
-		setUpGUI();
+		//setUpGUI();
 		setUpInput();
 		setUpInput();
 	}
 	}
 
 
@@ -261,9 +261,9 @@ namespace bs
 		
 		
 		// Attach the Renderable component and hook up the mesh we imported earlier,
 		// Attach the Renderable component and hook up the mesh we imported earlier,
 		// and the material we created in the previous section.
 		// and the material we created in the previous section.
-		HRenderable renderable = dragonSO->addComponent<CRenderable>();
-		renderable->setMesh(mesh);
-		renderable->setMaterial(material);
+		//HRenderable renderable = dragonSO->addComponent<CRenderable>();
+		//renderable->setMesh(mesh);
+		//renderable->setMaterial(material);
 
 
 		/************************************************************************/
 		/************************************************************************/
 		/* 									CAMERA	                     		*/
 		/* 									CAMERA	                     		*/
@@ -415,7 +415,7 @@ namespace bs
 		elemLayout->addElement(toggleFullscreenButton);
 		elemLayout->addElement(toggleFullscreenButton);
 
 
 		// Add a profiler overlay object that is responsible for displaying CPU and GPU profiling GUI
 		// Add a profiler overlay object that is responsible for displaying CPU and GPU profiling GUI
-		profilerOverlay = guiSO->addComponent<ProfilerOverlay>(guiCamera->_getCamera());
+		//profilerOverlay = guiSO->addComponent<ProfilerOverlay>(guiCamera->_getCamera());
 
 
 		// Set up video mode list box
 		// Set up video mode list box
 		// First get a list of output devices
 		// First get a list of output devices