Skip to content

Get 'safe' resting position from ShapeCast #1005

Answered by jrouwe
SSNTails asked this question in Q&A
Discussion options

You must be logged in to vote

If you do shapeCast.GetPointOnRay(hit.mFraction) you'll get the position of the center of mass of the shape when it is touching the target object. If you want to get a 'safe position' you need to subtract a bit from that value (but how much exactly is hard to say as it depends on the size of the object you're casting and the length of the ray along which you cast - floating point errors are really hard to predict). Usually a couple of mm is enough.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by SSNTails
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants