feat: Add VehicleComponent with serialization, scripting, and runtime…#387
Conversation
… support - Implemented VehicleComponent with properties for vehicle dynamics including half track width, axle offsets, wheel dimensions, suspension parameters, and driver inputs. - Added serialization support for VehicleComponent to ensure proper saving and loading of component state. - Integrated VehicleComponent into the Lua and C# scripting systems, allowing for manipulation of vehicle properties from scripts. - Created tests to validate the functionality of VehicleComponent, including physics interactions, suspension behavior, and save-game round-trip integrity. - Updated Scene class to handle vehicle addition and removal during runtime, ensuring proper management of vehicle constraints in the physics engine.
|
Warning Review limit reached
More reviews will be available in 24 minutes and 28 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (13)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Resolve the AllComponents tuple conflict in Scene/Components.h: master moved the hand-maintained AllComponents ComponentGroup<...> list into OloHeaderTool codegen (#include Scene/Generated/AllComponents.Generated.inl). Took master's generated-include side and dropped the hand-written list; VehicleComponent is a struct *Component definition, so GenerateBindings now registers it in the regenerated tuple automatically (verified by ComponentTupleCoverage). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Self-review of the VehicleComponent PR surfaced reachable use-after-free / assert paths in the vehicle runtime lifecycle. A VehicleConstraint is a live Jolt step listener that dereferences its chassis body every tick, so it must be torn down before that body is freed. - Scene::DestroyEntity now destroys the vehicle (vehicle-before-body) before registry.destroy(); entt's registry.destroy does NOT fire OnComponentRemoved, so the constraint would otherwise outlive its freed chassis body. - Scene::OnComponentRemoved<Rigidbody3DComponent> destroys the vehicle before destroying the chassis body it drives. - JoltScene::UpdateVehicleControllers uses the non-asserting TryGetEntityWithUUID instead of GetEntityByUUID, so a transient m_Vehicles/entity desync degrades to a clean skip instead of an assert/UB on the physics tick. - JoltScene::CreateVehicle: allow an authored SuspensionMinLength of 0 (the contract and serializers permit 0 <= min; SanitizeVehiclePositive wrongly rewrote 0 to the default), and fall steer-angle back to 0 (steering disabled) on a non-finite value, matching the documented intent. Adds two regression tests: DestroyingVehicleEntityReleasesTheConstraint and RemovingChassisRigidbodyReleasesTheVehicle. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🤖 Self-review (finish-pr) @
|



… support