ghoflvhxj Posted October 12, 2014 Share Posted October 12, 2014 I use EntityCollisionCallback function to embody falling damage. Like this. void _stdcall EntityCollisionCallback(TEntity entity0, TEntity entity1, byte* position, byte* normal, byte* force, flt speed) { ... } SetEntityCallback(controller,(byte*)EntityCollisionCallback,ENTITYCALLBACK_COLLISION); But, "force" and "speed" parameter have only 0. Not to get 0 What can i do? Quote Link to comment Share on other sites More sharing options...
macklebee Posted October 13, 2014 Share Posted October 13, 2014 how are you reading the value of force? if memory serves, its a Vec3 in that function. 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...
ghoflvhxj Posted October 14, 2014 Author Share Posted October 14, 2014 how are you reading the value of force? if memory serves, its a Vec3 in that function. Thanks for your reply. By the way, Did you know why speed parameter have 0? Quote Link to comment Share on other sites More sharing options...
macklebee Posted October 14, 2014 Share Posted October 14, 2014 By the way, Did you know why speed parameter have 0? Not offhand. I just tried LE2's lua object collision function with an oildrum by printing out force and speed values and it seems to work. Results: Speed: 1.8775409460068 Force: 0,0,0 Speed: 1.8775409460068 Force: -2.0766906416725e-008,109.9765625,0 ... ... What is the entity being used in the callback? Is the character controller 'entity0'? Worse case, you could try manually calculating the speed of the controller whenever it is airbourne. You could also try GetBodyVelocity(), but I cannot remember if it will work on a controller. 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...
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.