Reorder properties and add center of mass debug drawing

This commit is contained in:
Wojtek Figat
2021-03-26 15:47:00 +01:00
parent f216528f40
commit 3f68a0576d
2 changed files with 12 additions and 7 deletions

View File

@@ -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();
}

View File

@@ -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>