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
@@ -16,10 +16,12 @@ Actionable task list for this project. This file is the single, central place fo
|
||||
- [A] Model one vehicle in Blender with collision meshes; export to Unreal. **Model done** (`Tools/vehicle_build.py` → `Art/blender/vehicle/gigline-sedan.blend`, preview in `Art/blender/vehicle/preview.png`): 4.72 x 1.80 x 1.44 m, 2.78 m wheelbase, 1.62 m track, 0.33 m wheels, 252 triangles, four `UCX_` convex hulls. Dimensions come from real sedan figures and are logged to the report, so the vehicle config can read them rather than restating them. - **Imported into Unreal** (`Tools/ue_vehicle_import.py` → `/Game/Hollywood/Vehicle`), split per the vehicle-artist object split: `SM_Vehicle_Body` (3 slots, 4.76 x 1.76 x 1.28 m), `SM_Vehicle_Glass`, `SM_Vehicle_Light_Front`, `SM_Vehicle_Light_Rear`, `SM_Vehicle_Mirrors`, and one `SM_Vehicle_Wheel` (0.22 x 0.66 x 0.66 m) reused four times. The body FBX carries the `UCX_` hulls as simple collision.
|
||||
- **LODs cut for real:** decimating the duplicate gives LOD1 at 38 triangles and LOD2 at 14, against 132 for LOD0. The first attempt duplicated the shell unchanged and produced 84-triangle LODs that saved nothing - worth remembering as the failure mode of a "LOD" step nobody measures.
|
||||
- **LOD group wiring is open:** `StaticMeshEditorSubsystem.import_lod` is unavailable in a headless commandlet (`get_editor_subsystem` returns None), so the LOD meshes import as their own assets and the group still needs an editor session.
|
||||
- [A] Set up Chaos Vehicle with wheel and physics configuration. **Blocked on the physics asset, which cannot be generated headless.**
|
||||
- **Skeletal vehicle asset is in** (`SK_Vehicle_Sedan` + `SK_Vehicle_Sedan_Skeleton`): one mesh carrying a root bone and four wheel bones, every wheel skinned to its own bone, exported with the character preset (508 triangles). Chaos drives a skeletal mesh, so the static split alone was not drivable.
|
||||
- **Blocked:** Chaos needs a `PhysicsAsset`, and `unreal.PhysicsAssetFactory` in 5.8 exposes **no mesh property** (`Failed to find property 'skeletal_mesh'`), so the bodies cannot be generated from the skeletal mesh in a commandlet. Options: author it once in the editor and commit it, or build it in C++ with `FPhysicsAssetUtils` in an editor utility.
|
||||
- **Next:** create the physics asset (root box + four wheel capsules at the modelled positions: wheelbase 2.78 m, track 1.62 m, radius 0.33 m), then the `UChaosWheeledVehicleMovementComponent` config reads those same numbers from `Art/blender/vehicle` report.
|
||||
- [~] Set up Chaos Vehicle with wheel and physics configuration. **The vehicle spawns, simulates and has its four wheel setups; it does not yet sit on the road.**
|
||||
- **Physics asset generated from script.** `unreal.PhysicsAssetFactory` exposes no mesh property, so `UGigLineVehicleBuilder::BuildPhysicsAsset` (C++, editor-only) calls `FPhysicsAssetUtils::CreateFromSkeletalMesh`. Result: `PA_Vehicle_Sedan` with **6 bodies**, assigned to `SK_Vehicle_Sedan`.
|
||||
- **Vehicle class in place.** `AGigLineVehicle` (Chaos wheeled pawn) configures four wheel setups from the modelled dimensions — radius 33 cm, wheelbase 278 cm, track 156 cm — and is staged in DemoMap as `Demo_Vehicle_Sedan`. A run logs `spawned at (-12950, -900, 120), 4 wheel setups`.
|
||||
- **Defect:** it settles at **Z 494 cm** instead of road level (spawned at 120). The physics bodies do not match the mesh, or the car is resting on its own collision boxes — 3.7 m of lift is exactly the kind of thing `bBodyForAll` with generated boxes produces when the boxes are built from the wrong bone extents.
|
||||
- **Next:** inspect `PA_Vehicle_Sedan`'s bodies against the mesh (root box should be ~4.7 x 1.8 x 0.5 m, wheels ~0.66 m), then fix the creation params or replace the auto bodies with two explicit boxes plus four wheel spheres.
|
||||
- **Also open:** LOD group wiring, enter/exit, driving route, handling.
|
||||
- [ ] Implement enter/exit interaction.
|
||||
- [ ] Build a closed driving route with boundaries.
|
||||
- [ ] Tune basic handling to a drivable state.
|
||||
|
||||
Reference in new issue
Block a user