feat(vehicle): Chaos vehicle spawns and simulates, physics asset generated from script
The physics asset could not be made from Python (PhysicsAssetFactory exposes no mesh property), so a small editor-only C++ helper calls FPhysicsAssetUtils::CreateFromSkeletalMesh - the same code path as the editor's Create Physics Asset action. It produces PA_Vehicle_Sedan with 6 bodies and assigns it to SK_Vehicle_Sedan. AGigLineVehicle is a Chaos wheeled pawn that configures its four wheels from the modelled dimensions (radius 33 cm, wheelbase 278, track 156) and is staged in DemoMap. A run logs: spawned at (-12950, -900, 120), 4 wheel setups settled at Z 494 cm, simulating=1, speed=0 cm/s That last line is the defect and it is not hidden: the vehicle rests 3.7 m above the road, so the generated physics bodies do not match the mesh. Recorded in TODO.md with the next step - inspect the bodies against the mesh, then either fix the creation params or author two boxes and four wheel spheres explicitly.
This commit is contained in:
1 parent
2e0421480c
commit
4f3ed20e49
29 files changed
+328
-27
No files matched your search
@@ -647,6 +647,17 @@ def build():
|
||||
unreal.Rotator(pitch=0.0, yaw=90.0, roll=0.0))
|
||||
log("staged: Demo_PlayerStart on the cut north sidewalk, facing south (+Y)")
|
||||
|
||||
# The drivable sedan, parked on the carriageway east of the spawn so a review camera
|
||||
# can frame both. Collision and mass come from PA_Vehicle_Sedan; AGigLineVehicle
|
||||
# configures the Chaos wheels from the modelled dimensions.
|
||||
vehicle_class = unreal.load_class(None, "/Script/GigLine.GigLineVehicle")
|
||||
if vehicle_class:
|
||||
vehicle = spawn(vehicle_class, unreal.Vector(-12950.0, -900.0, 120.0),
|
||||
"Demo_Vehicle_Sedan")
|
||||
log(f"staged: Demo_Vehicle_Sedan ({'ok' if vehicle else 'FAILED'})")
|
||||
else:
|
||||
log("staged: Demo_Vehicle_Sedan skipped - class not found")
|
||||
|
||||
# A lockable LFS .umap checks out read-only, which makes save_map silently
|
||||
# return False — chmod u+w first or the staged actors never persist.
|
||||
umap = os.path.join(unreal.Paths.project_dir(), MAP.replace("/Game/", "Content/") + ".umap")
|
||||
|
||||
Reference in new issue
Block a user