using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace BansheeEngine
{
/** @addtogroup Physics
* @{
*/
///
/// Controls spring parameters for a physics joint limits. If a limit is soft (body bounces back due to restition when
/// the limit is reached) the spring will pull the body back towards the limit using the specified parameters.
///
[StructLayout(LayoutKind.Sequential), SerializeObject]
public partial struct Spring
{
/// Initializes the struct with default values.
public static Spring Default()
{
Spring value = new Spring();
value.stiffness = 0f;
value.damping = 0f;
return value;
}
/// Constructs a spring.
/// Spring strength. Force proportional to the position error.
/// Damping strength. Force propertional to the velocity error.
public Spring(float stiffness, float damping)
{
this.stiffness = stiffness;
this.damping = damping;
}
/// Spring strength. Force proportional to the position error.
public float stiffness;
/// Damping strength. Force propertional to the velocity error.
public float damping;
}
/** @} */
}