4 #include "scene/3d/physics_body.h" 21 Vector3 m_chassisConnectionPointCS;
25 real_t m_suspensionRestLength;
26 real_t m_maxSuspensionTravelCm;
29 real_t m_suspensionStiffness;
30 real_t m_wheelsDampingCompression;
31 real_t m_wheelsDampingRelaxation;
32 real_t m_frictionSlip;
33 real_t m_maxSuspensionForce;
42 real_t m_deltaRotation;
43 real_t m_rollInfluence;
47 real_t m_clippedInvContactDotSuspension;
48 real_t m_suspensionRelativeVelocity;
50 real_t m_wheelsSuspensionForce;
58 real_t m_suspensionLength;
66 void _update(PhysicsDirectBodyState *s);
69 void _notification(
int p_what);
70 static void _bind_methods();
74 void set_radius(
float p_radius);
75 float get_radius()
const;
77 void set_suspension_rest_length(
float p_length);
78 float get_suspension_rest_length()
const;
80 void set_suspension_travel(
float p_length);
81 float get_suspension_travel()
const;
83 void set_suspension_stiffness(
float p_value);
84 float get_suspension_stiffness()
const;
86 void set_suspension_max_force(
float p_value);
87 float get_suspension_max_force()
const;
89 void set_damping_compression(
float p_value);
90 float get_damping_compression()
const;
92 void set_damping_relaxation(
float p_value);
93 float get_damping_relaxation()
const;
95 void set_friction_slip(
float p_value);
96 float get_friction_slip()
const;
98 void set_use_as_traction(
bool p_enable);
99 bool is_used_as_traction()
const;
101 void set_use_as_steering(
bool p_enabled);
102 bool is_used_as_steering()
const;
123 real_t m_pitchControl;
124 real_t m_steeringValue;
125 real_t m_currentVehicleSpeedKmHour;
134 struct btVehicleWheelContactPoint {
135 PhysicsDirectBodyState *m_s;
137 Vector3 m_frictionPositionWorld;
138 Vector3 m_frictionDirectionWorld;
139 real_t m_jacDiagABInv;
143 btVehicleWheelContactPoint(PhysicsDirectBodyState *s,
PhysicsBody* body1,
const Vector3& frictionPosWorld,
const Vector3& frictionDirectionWorld, real_t maxImpulse);
146 void _resolve_single_bilateral(PhysicsDirectBodyState *s,
const Vector3& pos1,
PhysicsBody* body2,
const Vector3& pos2,
const Vector3& normal, real_t& impulse);
147 real_t _calc_rolling_friction(btVehicleWheelContactPoint& contactPoint);
149 void _update_friction(PhysicsDirectBodyState *s);
150 void _update_suspension(PhysicsDirectBodyState *s);
151 real_t _ray_cast(
int p_idx,PhysicsDirectBodyState *s);
152 void _update_wheel_transform(
VehicleWheel& wheel ,PhysicsDirectBodyState *s);
153 void _update_wheel(
int p_idx,PhysicsDirectBodyState *s);
160 static void _bind_methods();
162 void _direct_state_changed(
Object *p_state);
166 void set_mass(real_t p_mass);
167 real_t get_mass()
const;
169 void set_friction(real_t p_friction);
170 real_t get_friction()
const;
172 void set_engine_force(
float p_engine_force);
173 float get_engine_force()
const;
175 void set_brake(
float p_force);
176 float get_brake()
const;
178 void set_steering(
float p_steering);
179 float get_steering()
const;
185 #endif // VEHICLE_BODY_H
Definition: vehicle_body.h:109
Definition: vehicle_body.h:8
Definition: physics_body.h:37