Path: blob/master/thirdparty/jolt_physics/Jolt/Physics/Vehicle/VehicleAntiRollBar.h
9912 views
// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)1// SPDX-FileCopyrightText: 2021 Jorrit Rouwe2// SPDX-License-Identifier: MIT34#pragma once56#include <Jolt/ObjectStream/SerializableObject.h>7#include <Jolt/Core/StreamIn.h>8#include <Jolt/Core/StreamOut.h>910JPH_NAMESPACE_BEGIN1112/// An anti rollbar is a stiff spring that connects two wheels to reduce the amount of roll the vehicle makes in sharp corners13/// See: https://en.wikipedia.org/wiki/Anti-roll_bar14class JPH_EXPORT VehicleAntiRollBar15{16JPH_DECLARE_SERIALIZABLE_NON_VIRTUAL(JPH_EXPORT, VehicleAntiRollBar)1718public:19/// Saves the contents in binary form to inStream.20void SaveBinaryState(StreamOut &inStream) const;2122/// Restores the contents in binary form to inStream.23void RestoreBinaryState(StreamIn &inStream);2425int mLeftWheel = 0; ///< Index (in mWheels) that represents the left wheel of this anti-rollbar26int mRightWheel = 1; ///< Index (in mWheels) that represents the right wheel of this anti-rollbar27float mStiffness = 1000.0f; ///< Stiffness (spring constant in N/m) of anti rollbar, can be 0 to disable the anti-rollbar28};2930using VehicleAntiRollBars = Array<VehicleAntiRollBar>;3132JPH_NAMESPACE_END333435