Reorder properties and add center of mass debug drawing
This commit is contained in:
@@ -392,6 +392,7 @@ void WheeledVehicle::Setup()
|
||||
|
||||
void WheeledVehicle::DrawPhysicsDebug(RenderView& view)
|
||||
{
|
||||
// Wheels shapes
|
||||
for (auto& wheel : _wheels)
|
||||
{
|
||||
if (wheel.Collider && wheel.Collider->GetParent() == this && !wheel.Collider->GetIsTrigger())
|
||||
@@ -403,6 +404,7 @@ void WheeledVehicle::DrawPhysicsDebug(RenderView& view)
|
||||
|
||||
void WheeledVehicle::OnDebugDrawSelected()
|
||||
{
|
||||
// Wheels shapes
|
||||
for (auto& wheel : _wheels)
|
||||
{
|
||||
if (wheel.Collider && wheel.Collider->GetParent() == this && !wheel.Collider->GetIsTrigger())
|
||||
@@ -411,6 +413,9 @@ void WheeledVehicle::OnDebugDrawSelected()
|
||||
}
|
||||
}
|
||||
|
||||
// Center of mass
|
||||
DEBUG_DRAW_WIRE_SPHERE(BoundingSphere(_transform.LocalToWorld(_centerOfMassOffset), 10.0f), Color::Blue, 0, false);
|
||||
|
||||
RigidBody::OnDebugDrawSelected();
|
||||
}
|
||||
|
||||
|
||||
@@ -138,22 +138,22 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// If checked, the negative throttle value will be used as brake and reverse to behave in a more arcade style where holding reverse also functions as brake. Disable it for more realistic driving controls.
|
||||
/// </summary>
|
||||
API_FIELD(Attributes="EditorOrder(0), EditorDisplay(\"Vehicle\")")
|
||||
bool UseReverseAsBrake = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the vehicle wheels settings.
|
||||
/// </summary>
|
||||
API_PROPERTY(Attributes="EditorOrder(0), EditorDisplay(\"Vehicle\")") const Array<Wheel>& GetWheels() const;
|
||||
API_PROPERTY(Attributes="EditorOrder(1), EditorDisplay(\"Vehicle\")") const Array<Wheel>& GetWheels() const;
|
||||
|
||||
/// <summary>
|
||||
/// Sets the vehicle wheels settings.
|
||||
/// </summary>
|
||||
API_PROPERTY() void SetWheels(const Array<Wheel>& value);
|
||||
|
||||
/// <summary>
|
||||
/// If checked, the negative throttle value will be used as brake and reverse to behave in a more arcade style where holding reverse also functions as brake. Disable it for more realistic driving controls.
|
||||
/// </summary>
|
||||
API_FIELD(Attributes="EditorOrder(1), EditorDisplay(\"Vehicle\")")
|
||||
bool UseReverseAsBrake = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the vehicle gearbox settings.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user