OSDN Git Service

Dividing by zero and using the result as the weight in an interpolation .. is not...
authorRobin Cornelius <robin.cornelius@gmail.com>
Thu, 4 Aug 2011 19:07:44 +0000 (19:07 +0000)
committerRobin Cornelius <robin.cornelius@gmail.com>
Thu, 4 Aug 2011 19:07:44 +0000 (19:07 +0000)
git-svn-id: https://radegast.googlecode.com/svn/trunk@1059 f7a694da-4d33-11de-9ad6-1127a62b9fcd

Radegast/GUI/Rendering/RenderingHelpers.cs

index bdbe10b..5fb156c 100644 (file)
@@ -2441,9 +2441,12 @@ namespace Radegast.Rendering
                             binBVHJointKey rot = b.joints[jpos].rotationkeys[state.lastkeyframe_rot];\r
                             rot2 = b.joints[jpos].rotationkeys[state.nextkeyframe_rot];\r
 \r
-                            float deltarot = (rot2.time - rot.time) / ((state.currenttime_rot) - (rot.time - b.joints[jpos].rotationkeys[0].time));\r
-\r
-\r
+                            float deltarot = 0;\r
+                            if (state.currenttime_rot != (rot.time - b.joints[jpos].rotationkeys[0].time))\r
+                            {\r
+                                deltarot = (rot2.time - rot.time) / ((state.currenttime_rot) - (rot.time - b.joints[jpos].rotationkeys[0].time));\r
+                            }\r
+                           \r
                             if (deltarot < 0)\r
                                 deltarot = 0;\r
 \r