Class VehiclePhysicsBuilder
- Namespace
- LibreRally.Vehicle.Physics
- Assembly
- LibreRally.dll
Builds the Stride entity graph and BEPU physics bodies for an assembled vehicle definition, including the chassis body and four wheel bodies connected by suspension constraints.
public static class VehiclePhysicsBuilder
- Inheritance
-
VehiclePhysicsBuilder
- Inherited Members
Methods
BeamNGToStride(Vector3)
Converts a BeamNG-space vector to Stride-space coordinates.
public static Vector3 BeamNGToStride(Vector3 v)
Parameters
vVector3Vector expressed in BeamNG coordinates (X right, Y forward, Z up).
Returns
- Vector3
Equivalent vector in Stride coordinates (X right, Y up, Z backward).
Build(VehicleDefinition, IReadOnlyDictionary<string, float>?)
Creates a root entity containing:
- A chassis entity with a BodyComponent and compound box colliders.
- One entity per detachable part, each with a BodyComponent and a WeldConstraintComponent connecting it to the chassis.
- Four wheel entities with suspension constraints.
public static VehicleBuilderResult Build(VehicleDefinition def, IReadOnlyDictionary<string, float>? preferredSetupVars = null)
Parameters
defVehicleDefinitionAssembled vehicle definition containing nodes, parts, and beam metadata.
preferredSetupVarsIReadOnlyDictionary<string, float>Optional active .pc setup values that should override merged JBeam defaults.
Returns
- VehicleBuilderResult
A VehicleBuilderResult containing the created entities and chassis body.
Exceptions
- InvalidOperationException
Thrown when the vehicle definition does not contain a non-detachable chassis part.