Jump to content

Recommended Posts

Posted

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.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Posted

There's no need for that, because when the collision occurs, you can always check the position of entity0 or entity1.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Posted

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...

Blog & Portfolio

 

Current project: moon.chase.star

Posted

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.

My job is to make tools you love, with the features you want, and performance you can't live without.

Posted

But yeah, physics preserving teleports are possible and easy to do. I already did them in the LCP1 game years ago.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...