Skip to content

Commit

Permalink
fixed show center of mass in editor.
Browse files Browse the repository at this point in the history
  • Loading branch information
JulioJerez committed Oct 23, 2024
1 parent e7a5ca3 commit 1c06ec7
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 1 deletion.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,16 @@ void UNewtonCollision::ApplyPropertyChanges()
ndVector UNewtonCollision::GetVolumePosition() const
{
ndVector posit(0.0f);
const ndShapeInstance* const instance = CreateInstanceShape();
ndShapeInstance* const instance = CreateInstanceShape();
if (instance)
{
//const FVector uScale(GetComponentTransform().GetScale3D());
//const ndVector scale(ndFloat32(uScale.X), ndFloat32(uScale.Y), ndFloat32(uScale.Z), ndFloat32(0.0f));
instance->SetScale(ndVector(1.0f));

const ndMatrix inertia(instance->CalculateInertia());
posit = inertia.m_posit;

posit.m_w = instance->GetVolume();
delete instance;
}
Expand Down

0 comments on commit 1c06ec7

Please sign in to comment.