|
Engine²
Open-source game engine written in C++.
|
Specialized builder for 4-wheel vehicles. More...
#include <VehicleBuilder.hpp>
Public Member Functions | |
| VehicleBuilder & | SetChassisMesh (const Object::Component::Mesh &chassisMesh, const glm::vec3 &position=glm::vec3(0.0f), const glm::quat &rotation=glm::quat(1.0f, 0.0f, 0.0f, 0.0f), const glm::vec3 &scale=glm::vec3(1.0f)) |
| Set the chassis mesh and initial transform. | |
| VehicleBuilder & | SetWheelMesh (Component::WheelIndex index, const Object::Component::Mesh &wheelMesh) |
| Set mesh for a specific wheel. | |
| VehicleBuilder & | SetWheelSettings (Component::WheelIndex index, const Component::WheelSettings &settings) |
| Set wheel settings for a specific wheel. | |
| VehicleBuilder & | SetMaxBrakeTorque (Component::WheelIndex index, float torque) |
| Set maximum brake torque for a specific wheel. | |
| VehicleBuilder & | SetMaxHandBrakeTorque (Component::WheelIndex index, float torque) |
| Set maximum handbrake torque for a specific wheel. | |
| VehicleBuilder & | SetDrivetrain (Component::DrivetrainType drivetrain) |
| Set drivetrain type (AWD, FWD, RWD). | |
| VehicleBuilder & | SetEngine (const Component::EngineSettings &engine) |
| Set engine configuration. | |
| VehicleBuilder & | SetGearbox (const Component::GearboxSettings &gearbox) |
| Set gearbox configuration. | |
| VehicleBuilder & | SetRollbar (const Component::RollbarSettings &rollbar) |
| Set rollbar configuration. | |
| VehicleBuilder & | SetWheelPositions (const glm::vec3 &frontLeft, const glm::vec3 &frontRight, const glm::vec3 &rearLeft, const glm::vec3 &rearRight) |
| Set wheel offset positions relative to chassis center. | |
| Engine::Entity | Build (Engine::Core &core) |
| Build the vehicle and create all entities. | |
| VehicleBuilder & | SetChassisMass (float mass) |
| Set chassis mass in kilograms. | |
| VehicleBuilder & | SetCollisionTesterType (Component::CollisionTesterType type) |
| Set the collision tester type for wheel-ground detection. | |
| VehicleBuilder & | SetConvexRadiusFraction (float fraction) |
| Set the convex radius fraction for CastCylinder tester. | |
Private Attributes | |
| Component::Vehicle | _vehicle = Component::Vehicle::CreateDefaultCar() |
| Object::Component::Mesh | _chassisMesh |
| glm::vec3 | _chassisPosition = glm::vec3(0.0f) |
| glm::quat | _chassisRotation = glm::quat(1.0f, 0.0f, 0.0f, 0.0f) |
| glm::vec3 | _chassisScale = glm::vec3(1.0f) |
| float | _chassisMass = 1500.0f |
| std::array< Object::Component::Mesh, 4 > | _wheelMeshes |
| std::array< glm::vec3, 4 > | _wheelPositions = Component::Vehicle::GetDefaultWheelPositions() |
| bool | _hasChassisSet = false |
| std::array< bool, 4 > | _hasWheelMesh = {false, false, false, false} |
Specialized builder for 4-wheel vehicles.
|
inline |
Build the vehicle and create all entities.
Creates:
The VehicleSystem will automatically create the Jolt constraint when the Vehicle component is constructed.
| core | Engine core reference |
|
inline |
Set chassis mass in kilograms.
|
inline |
Set the chassis mesh and initial transform.
| chassisMesh | Mesh for the vehicle body |
| position | Initial position of the chassis |
| rotation | Initial rotation of the chassis |
| scale | Scale of the chassis mesh |
|
inline |
Set the collision tester type for wheel-ground detection.
|
inline |
Set the convex radius fraction for CastCylinder tester.
| fraction | Value between 0.0 and 1.0 (default: 0.5) |
|
inline |
Set drivetrain type (AWD, FWD, RWD).
|
inline |
Set engine configuration.
|
inline |
Set gearbox configuration.
|
inline |
Set maximum brake torque for a specific wheel.
| index | Wheel position |
| torque | Maximum brake torque in Nm (default: 1500.0f) |
|
inline |
Set maximum handbrake torque for a specific wheel.
Usually only applied to rear wheels.
| index | Wheel position |
| torque | Maximum handbrake torque in Nm (default: 4000.0f) |
|
inline |
Set rollbar configuration.
|
inline |
Set mesh for a specific wheel.
| index | Wheel position (FrontLeft, FrontRight, RearLeft, RearRight) |
| wheelMesh | Mesh for the wheel visual |
|
inline |
Set wheel offset positions relative to chassis center.
Default positions assume a standard car layout:
| frontLeft | Position of front-left wheel |
| frontRight | Position of front-right wheel |
| rearLeft | Position of rear-left wheel |
| rearRight | Position of rear-right wheel |
|
inline |
Set wheel settings for a specific wheel.
| index | Wheel position |
| settings | Wheel physical properties |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |