{"action":"opened","issue":{"url":"https://api.github.com/repos/pdelia/away3d/issues/150","labels_url":"https://api.github.com/repos/pdelia/away3d/issues/150/labels{/name}","comments_url":"https://api.github.com/repos/pdelia/away3d/issues/150/comments","events_url":"https://api.github.com/repos/pdelia/away3d/issues/150/events","html_url":"https://github.com/pdelia/away3d/issues/150","id":85658331,"number":150,"title":"Patch - core math - Number3D transform() and rotate() methods","user":{"login":"pdelia","id":12096091,"avatar_url":"https://avatars.githubusercontent.com/u/12096091?v=3","gravatar_id":"","url":"https://api.github.com/users/pdelia","html_url":"https://github.com/pdelia","followers_url":"https://api.github.com/users/pdelia/followers","following_url":"https://api.github.com/users/pdelia/following{/other_user}","gists_url":"https://api.github.com/users/pdelia/gists{/gist_id}","starred_url":"https://api.github.com/users/pdelia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdelia/subscriptions","organizations_url":"https://api.github.com/users/pdelia/orgs","repos_url":"https://api.github.com/users/pdelia/repos","events_url":"https://api.github.com/users/pdelia/events{/privacy}","received_events_url":"https://api.github.com/users/pdelia/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pdelia/away3d/labels/auto-migrated","name":"auto-migrated","color":"ededed"},{"url":"https://api.github.com/repos/pdelia/away3d/labels/Priority-Medium","name":"Priority-Medium","color":"ededed"},{"url":"https://api.github.com/repos/pdelia/away3d/labels/Type-Defect","name":"Type-Defect","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-05T23:49:00Z","updated_at":"2015-06-05T23:49:00Z","closed_at":null,"body":"#6 Issue by __GoogleCodeExporter__, created on: 2015-04-24T07:51:00Z\n\n```\nSmall fix, but cost me alot of time.in debugging.  The  transform() method of \nNumber3D should grab a copy of the values of the input Number3D in case it's a \nself \nreferencing call as such as: \n\nmyVect.transform(myVect, rotMatrix ); \n\nProblems will occur in the current svn version because since we feed itself as \nv to the method, once the assignement to the x class member is done it is used \nto \nsubsequently as v.x to calculate the remaining dimensions causing huge \ndisplacement. \n\n/me takes a couple of pills to remove the headache \n\nSame thing is true for the rotate() method of the same class. \n\nThanks! \nBen \n\n\n\nIndex: /Users/bbeausej/Documents/DEV/Away3d/src/away3d/core/math/ \nNumber3D.as \n=================================================================== \n--- /Users/bbeausej/Documents/DEV/Away3d/src/away3d/core/math/ \nNumber3D.as     (revision 552) \n+++ /Users/bbeausej/Documents/DEV/Away3d/src/away3d/core/math/ \nNumber3D.as     (working copy) \n@@ -180,9 +180,13 @@ \n         */ \n         public function rotate(v:Number3D, m:Matrix3D):void \n         { \n-            x = v.x * m.sxx + v.y * m.sxy + v.z * m.sxz; \n-            y = v.x * m.syx + v.y * m.syy + v.z * m.syz; \n-            z = v.x * m.szx + v.y * m.szy + v.z * m.szz; \n+               var vx:Number = v.x; \n+               var vy:Number = v.y; \n+               var vz:Number = v.z; \n+ \n+            x = vx * m.sxx + vy * m.sxy + vz * m.sxz; \n+            y = vx * m.syx + vy * m.syy + vz * m.syz; \n+            z = vx * m.szx + vy * m.szy + vz * m.szz; \n         } \n        /** \n@@ -193,9 +197,14 @@ \n         */ \n         public function transform(v:Number3D, m:Matrix3D):void \n         { \n-            x = v.x * m.sxx + v.y * m.sxy + v.z * m.sxz + m.tx; \n-            y = v.x * m.syx + v.y * m.syy + v.z * m.syz + m.ty; \n-            z = v.x * m.szx + v.y * m.szy + v.z * m.szz + m.tz; \n+               var vx:Number = v.x; \n+               var vy:Number = v.y; \n+               var vz:Number = v.z; \n+ \n+ \n+            x = vx * m.sxx + vy * m.sxy + vz * m.sxz + m.tx; \n+            y = vx * m.syx + vy * m.syy + vz * m.syz + m.ty; \n+            z = vx * m.szx + vy * m.szy + vz * m.szz + m.tz; \n         } \n         /** \n \n```\n\nOriginal issue reported on code.google.com by `bbeau...@gmail.com` on 5 Jun 2008 at 6:50"}}