Bläddra i källkod

Optimized skeletal animation application in SceneMesh a bit, added proper version to OS X IDE plist

Ivan Safrin 12 år sedan
förälder
incheckning
69df188c23

+ 5 - 15
Core/Contents/Source/PolySceneMesh.cpp

@@ -254,22 +254,12 @@ void SceneMesh::renderMeshLocally() {
 	Renderer *renderer = CoreServices::getInstance()->getRenderer();
 	Renderer *renderer = CoreServices::getInstance()->getRenderer();
 	
 	
 	if(skeleton) {	
 	if(skeleton) {	
-		for(int i=0; i < mesh->getVertexCount(); i++) {
-            Vertex *vert = mesh->getVertex(i);
+		for(int i=0; i < mesh->getActualVertexCount(); i++) {
+            Vertex *vert = mesh->getActualVertex(i);
             Vector3 norm;
             Vector3 norm;
             
             
-            Vector3 aPos = vert->restPosition;
             Vector3 tPos;
             Vector3 tPos;
 
 
-            Number mult = 1;					
-/*
-            Number mult = 0;
-            for(int b =0; b < vert->getNumBoneAssignments(); b++) {
-                BoneAssignment *bas = vert->getBoneAssignment(b);
-                mult += bas->weight;
-            }
-            mult = 1.0f/mult;
-*/				
             for(int b =0; b < vert->getNumBoneAssignments(); b++) {
             for(int b =0; b < vert->getNumBoneAssignments(); b++) {
                 BoneAssignment *bas = vert->getBoneAssignment(b);
                 BoneAssignment *bas = vert->getBoneAssignment(b);
                 Bone *bone = bas->bone;
                 Bone *bone = bas->bone;
@@ -278,14 +268,14 @@ void SceneMesh::renderMeshLocally() {
                     Matrix4 restMatrix = bone->getRestMatrix();
                     Matrix4 restMatrix = bone->getRestMatrix();
                     Matrix4 finalMatrix = bone->getFinalMatrix();
                     Matrix4 finalMatrix = bone->getFinalMatrix();
                     
                     
-                    Vector3 vec = restMatrix * aPos;
-                    tPos += finalMatrix * vec * (bas->weight*mult);
+                    Vector3 vec = restMatrix * vert->restPosition;
+                    tPos += finalMatrix * vec * (bas->weight);
                     
                     
                     Vector3 nvec = vert->restNormal;
                     Vector3 nvec = vert->restNormal;
                     nvec = restMatrix.rotateVector(nvec);
                     nvec = restMatrix.rotateVector(nvec);
                     nvec = finalMatrix.rotateVector(nvec);
                     nvec = finalMatrix.rotateVector(nvec);
                     
                     
-                    norm += nvec * (bas->weight*mult);
+                    norm += nvec * (bas->weight);
                 }
                 }
             }					
             }					
             
             

+ 1 - 1
IDE/Build/Mac OS X/Polycode-Info.plist

@@ -32,7 +32,7 @@
 	<key>CFBundlePackageType</key>
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
 	<key>CFBundleShortVersionString</key>
-	<string>0.8.2</string>
+	<string>0.8.4a_dev</string>
 	<key>CFBundleSignature</key>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<string>????</string>
 	<key>CFBundleVersion</key>
 	<key>CFBundleVersion</key>

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

@@ -1180,7 +1180,7 @@ void PolycodeIDEApp::loadConfigFile() {
 
 
 	globalSyntaxTheme = new SyntaxHighlightTheme();
 	globalSyntaxTheme = new SyntaxHighlightTheme();
 	
 	
-	String uiThemeName = "default";	
+	String uiThemeName = "dark";
 	
 	
 	CoreServices::getInstance()->getRenderer()->setTextureFilteringMode(Renderer::TEX_FILTERING_LINEAR);
 	CoreServices::getInstance()->getRenderer()->setTextureFilteringMode(Renderer::TEX_FILTERING_LINEAR);
 	
 	

+ 2 - 2
Modules/Contents/3DPhysics/Source/PolyCollisionSceneEntity.cpp

@@ -88,7 +88,7 @@ btCollisionShape *CollisionEntity::createCollisionShape(Entity *entity, int type
 	btCollisionShape *collisionShape = NULL;	
 	btCollisionShape *collisionShape = NULL;	
 	
 	
     Vector3 scale = entity->getCompoundScale();
     Vector3 scale = entity->getCompoundScale();
-    Vector3 bBox = entity->getLocalBoundingBox();// * scale;
+    Vector3 bBox = entity->getLocalBoundingBox() * scale;
 	
 	
     Number largestSize = bBox.x;
     Number largestSize = bBox.x;
     if(bBox.y > largestSize) {
     if(bBox.y > largestSize) {
@@ -144,7 +144,7 @@ btCollisionShape *CollisionEntity::createCollisionShape(Entity *entity, int type
 		break;
 		break;
 	}
 	}
     
     
-    collisionShape->setLocalScaling(btVector3(scale.x, scale.y, scale.z));
+   // collisionShape->setLocalScaling(btVector3(scale.x, scale.y, scale.z));
     
     
 	return collisionShape; 
 	return collisionShape; 
 }
 }