Antkeeper
0.0.1
|
Numeric spring. More...
#include <spring.hpp>
Public Types | |
using | value_type = T |
Value type. More... | |
using | scalar_type = S |
Scalar type. More... | |
Public Member Functions | |
constexpr void | solve (scalar_type dt) noexcept |
Solves the spring using the implicit Euler method. More... | |
constexpr void | set_value (const value_type &value) noexcept |
Sets the current value of the spring. More... | |
constexpr void | set_target_value (const value_type &value) noexcept |
Sets the target value of the spring. More... | |
constexpr void | set_velocity (const value_type &velocity) noexcept |
Sets the velocity of the spring. More... | |
constexpr void | set_damping_ratio (scalar_type ratio) noexcept |
Sets the damping ratio of the spring. More... | |
constexpr void | set_angular_frequency (scalar_type angular_frequency) noexcept |
Sets the angular frequency of the spring oscillation. More... | |
constexpr void | set_period (scalar_type period) noexcept |
Sets the oscillation period of the spring. More... | |
constexpr void | set_frequency (scalar_type frequency) noexcept |
Sets the oscillation frequency of the spring. More... | |
constexpr const value_type & | get_value () const noexcept |
Returns the current value of the spring. More... | |
constexpr const value_type & | get_target_value () const noexcept |
Returns the target value of the spring. More... | |
constexpr const value_type & | get_velocity () const noexcept |
Returns the velocity of the spring. More... | |
constexpr scalar_type | get_damping_ratio () const noexcept |
Returns the damping ratio of the spring. More... | |
constexpr scalar_type | get_angular_frequency () const noexcept |
Returns the angular frequency of the spring oscillation, in radians per second. More... | |
constexpr scalar_type | get_period () const noexcept |
Returns the oscillation period of the spring, in seconds. More... | |
constexpr scalar_type | get_frequency () const noexcept |
Returns the oscillation frequency of the spring, in hertz. More... | |
Numeric spring.
T | Value type. |
S | Scalar type. |
Definition at line 60 of file spring.hpp.
using physics::numeric_spring< T, S >::scalar_type = S |
Scalar type.
Definition at line 67 of file spring.hpp.
using physics::numeric_spring< T, S >::value_type = T |
Value type.
Definition at line 64 of file spring.hpp.
|
inlineconstexprnoexcept |
Returns the angular frequency of the spring oscillation, in radians per second.
Definition at line 174 of file spring.hpp.
|
inlineconstexprnoexcept |
Returns the damping ratio of the spring.
Definition at line 168 of file spring.hpp.
|
inlineconstexprnoexcept |
Returns the oscillation frequency of the spring, in hertz.
Definition at line 186 of file spring.hpp.
|
inlineconstexprnoexcept |
Returns the oscillation period of the spring, in seconds.
Definition at line 180 of file spring.hpp.
|
inlineconstexprnoexcept |
Returns the target value of the spring.
Definition at line 156 of file spring.hpp.
|
inlineconstexprnoexcept |
Returns the current value of the spring.
Definition at line 150 of file spring.hpp.
|
inlineconstexprnoexcept |
Returns the velocity of the spring.
Definition at line 162 of file spring.hpp.
|
inlineconstexprnoexcept |
Sets the angular frequency of the spring oscillation.
w | Angular frequency, in radians per second. |
Definition at line 124 of file spring.hpp.
|
inlineconstexprnoexcept |
Sets the damping ratio of the spring.
ratio | Damping ratio, which can be undamped (0 ), underdamped (< 1 ), critically damped (1 ), or overdamped (> 1 ). |
Definition at line 114 of file spring.hpp.
|
inlineconstexprnoexcept |
Sets the oscillation frequency of the spring.
frequency | Oscillation frequency, in hertz. |
Definition at line 144 of file spring.hpp.
|
inlineconstexprnoexcept |
Sets the oscillation period of the spring.
period | Oscillation period, in seconds. |
Definition at line 134 of file spring.hpp.
|
inlineconstexprnoexcept |
Sets the target value of the spring.
value | Target value. |
Definition at line 94 of file spring.hpp.
|
inlineconstexprnoexcept |
Sets the current value of the spring.
value | Current value. |
Definition at line 84 of file spring.hpp.
|
inlineconstexprnoexcept |
Sets the velocity of the spring.
velocity | Spring velocity. |
Definition at line 104 of file spring.hpp.
|
inlineconstexprnoexcept |
Solves the spring using the implicit Euler method.
dt | Delta time, in seconds. |
Definition at line 74 of file spring.hpp.