smashthewindow Posted February 19, 2012 Share Posted February 19, 2012 void _stdcall EntityCollisionCallback( TEntity entity0, TEntity entity1, byte* position, byte* normal, byte* force, flt speed ) Is the position, normal, force parameters relative to entity0 or entity1? Quote Blog & Portfolio Current project: moon.chase.star Link to comment Share on other sites More sharing options...
Canardia Posted February 19, 2012 Share Posted February 19, 2012 I think it's neither. It's the global position of the collision itself. For example if two spheres collide, it would be a point on both sphere's hull. 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...
smashthewindow Posted February 19, 2012 Author Share Posted February 19, 2012 I think it's neither. It's the global position of the collision itself. For example if two spheres collide, it would be a point on both sphere's hull. But then how would the normal or force vector be expressed in global coordinate? Also is there a LE function to change position relative to entity0? Quote Blog & Portfolio Current project: moon.chase.star Link to comment Share on other sites More sharing options...
Canardia Posted February 20, 2012 Share Posted February 20, 2012 There's no need for that, because when the collision occurs, you can always check the position of entity0 or entity1. 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...
smashthewindow Posted February 20, 2012 Author Share Posted February 20, 2012 I'm thinking of a teleport function which moves an entity with exactly the same movement info and relative position to the entrance as it came in, which is why I need the normals and the force. Does the movement info ( velocity, force) get preserved after PositionEntity()? I don't have access to a Windows platform till next weekend so unfortunately I cannot test this... Quote Blog & Portfolio Current project: moon.chase.star Link to comment Share on other sites More sharing options...
Josh Posted February 20, 2012 Share Posted February 20, 2012 The position and normal are in global space. There is no way to reposition a physics body without losing one frame of physics interactions, but you are unlikely to run into trouble. I would just get the velocity and angular velocity, then reposition the body, then set the velocities to what they just were. I would probably not do this in the collision callback, just set a value and then reposition the body after UpdatePhysics is finished, back in the main program body. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Canardia Posted February 20, 2012 Share Posted February 20, 2012 But yeah, physics preserving teleports are possible and easy to do. I already did them in the LCP1 game years ago. 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.