Andy Gilbert Posted November 28, 2012 Share Posted November 28, 2012 I seem to be able to get nothing from a CreateBodyPivot usin lua? I create the pivot, set its parent and then when i try to get the vlocity, i just get 0? Can any one confirm this? Thanks Andy Quote The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do. Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d Link to comment Share on other sites More sharing options...
Andy Gilbert Posted November 28, 2012 Author Share Posted November 28, 2012 Infact, i cannot get any "paranted" bodies properties such as velocity ETC? Is this a bug? Thanks Andy Quote The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do. Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d Link to comment Share on other sites More sharing options...
macklebee Posted November 28, 2012 Share Posted November 28, 2012 The body apparently needs mass to report velocity even if it is just a pivot... but then it has the unfortunate effect of falling through the scene. Give it mass and then making it a fixed joint instead of parenting seems to work though. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Andy Gilbert Posted November 28, 2012 Author Share Posted November 28, 2012 Ahh I see, is this a bug that need reporting? thanks Andy Quote The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do. Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d Link to comment Share on other sites More sharing options...
macklebee Posted November 28, 2012 Share Posted November 28, 2012 looks like it is intentional as it happens on other physics bodies as well, not just pivots Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Canardia Posted November 28, 2012 Share Posted November 28, 2012 You can calculate velocity yourself from the Vec3 position difference between 2 frames: p2 = p1 p1 = pivot.position speed = sqrt( (p2.x-p1.x)^2 + (p2.y-p1.y)^2 + (p2.y-p1.y)^2 ) Flip 0 Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Andy Gilbert Posted November 29, 2012 Author Share Posted November 29, 2012 Hi, what do you mean by between 2 frames? and the flip 0? Thanks Andy Quote The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do. Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d Link to comment Share on other sites More sharing options...
Canardia Posted November 29, 2012 Share Posted November 29, 2012 Just copy paste the code into your main loop, it calculates the speed of a pivot between 2 frames (flip changes a frame). Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.