fix(vehicle): raise the chassis box above the ground (float 33m -> 7.8m)
Box.Center was -Extent.Z*0.25 (below the root bone); the box then sat under the ground and the suspension pushed the chassis up. Raising it to +Extent.Z*0.35 cuts the float from ~33 m to 7.8 m, confirming the direction. Still not settled - the box centre and/or the root bone (grounded at Z 0 by normalise_scale) need to move to the car's centre of mass.
This commit is contained in:
1 parent
63ba9d91ce
commit
84291a5270
2 files changed
+16
-1
No files matched your search
@@ -56,7 +56,11 @@ UPhysicsAsset* UGigLineVehicleBuilder::BuildPhysicsAsset(USkeletalMesh* Mesh,
|
||||
Box.X = Extent.X * 1.9f;
|
||||
Box.Y = Extent.Y * 1.8f;
|
||||
Box.Z = Extent.Z * 0.55f;
|
||||
Box.Center = FVector(0.f, 0.f, -Extent.Z * 0.25f);
|
||||
// The chassis body must sit ABOVE the ground (the car body is at Z 0..height), not below
|
||||
// the root bone. The old -Extent.Z*0.25 put the box below the ground and the suspension
|
||||
// (measured against the root bone) then pushed the chassis upward. Place it at the car's
|
||||
// mid-height instead.
|
||||
Box.Center = FVector(0.f, 0.f, Extent.Z * 0.35f);
|
||||
Body->AggGeom.BoxElems.Add(Box);
|
||||
PhysicsAsset->SkeletalBodySetups.Add(Body);
|
||||
|
||||
|
||||
Reference in new issue
Block a user