Skip to content

CharacterVirtual Colliding at Center of Mass? #1113

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

You must be logged in to vote

The way you draw the world is correct. Now that you're mentioning that this is in Unreal it makes a lot more sense. Unreal uses cm units while Jolt uses meter units, so you probably tried to correct for this using:

CharShape->Draw(..., JPH::Vec3::sReplicate(100.0f), ...);

However, scaling a shape in Jolt always works in local space of the shape (from the center of mass in this case), so what you're (most likely) doing is passing a GetCenterOfMassTransform() that contains an offset in meters and scaling the shape from its center of mass by a factor 100. That means that the translation in the center of mass is a factor 100 too small and it appears that the capsule is with its center on the …

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@wirepair
Comment options

@jrouwe
Comment options

Answer selected by wirepair
@wirepair
Comment options

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