19 lines
464 B
C#
19 lines
464 B
C#
namespace VeloX;
|
|
|
|
public class BasicSuspension
|
|
{
|
|
private readonly Hinge Hinge;
|
|
|
|
public BasicSuspension( Vector3 wheel, Vector3 hingeBody, Vector3 hingeWheel )
|
|
{
|
|
Vector3 hingePoint = wheel - (hingeWheel - hingeBody);
|
|
Hinge = new Hinge( hingePoint, hingeWheel - hingeBody );
|
|
}
|
|
|
|
public virtual void GetWheelTransform( float travel, out Rotation rotation, out Vector3 position )
|
|
{
|
|
rotation = Rotation.Identity;
|
|
position = Hinge.Rotate( travel );
|
|
}
|
|
}
|