Antkeeper
0.0.1
|
Physics. More...
Namespaces | |
constants | |
Physical constants. | |
gas | |
light | |
Gas-related functions. | |
orbit | |
Orbital mechanics. | |
planck | |
Various forms of Planck's law. | |
time | |
Time-related functions. | |
Classes | |
class | collider_material |
Describes the collision response of a collider. More... | |
class | collider |
Abstract base class for collision objects. More... | |
class | box_collider |
Box collision object. More... | |
class | capsule_collider |
Capsule collision object. More... | |
class | mesh_collider |
Mesh collision object. More... | |
class | plane_collider |
Plane collision object. More... | |
class | sphere_collider |
Sphere collision object. More... | |
struct | collision_contact |
Point of contact between two colliding bodies. More... | |
struct | collision_manifold |
Collection of contact points between two colliding bodies. More... | |
class | constraint |
Abstract base class for rigid body constraints. More... | |
class | spring_constraint |
Spring constraint. More... | |
class | rigid_body |
Rigid body. More... | |
class | numeric_spring |
Numeric spring. More... | |
Enumerations | |
enum class | collider_type : std::uint8_t { plane , sphere , box , capsule , mesh } |
Collider types. More... | |
enum class | friction_combine_mode : std::uint8_t { average , minimum , multiply , maximum } |
Specifies how coefficients of friction should be calculated. More... | |
enum class | restitution_combine_mode : std::uint8_t { average , minimum , multiply , maximum } |
Specifies how coefficients of restitution should be calculated. More... | |
Functions | |
template<class T > | |
constexpr T | hz_to_rads (T f) noexcept |
Converts frequency to angular frequency. More... | |
template<class T > | |
constexpr T | rads_to_hz (T w) noexcept |
Converts angular frequency to frequency. More... | |
template<class T > | |
constexpr T | s_to_rads (T t) noexcept |
Converts oscillation period to angular frequency. More... | |
template<class T > | |
constexpr T | rads_to_s (T w) noexcept |
Converts angular frequency to oscillation period. More... | |
float | combine_friction (float a, float b, friction_combine_mode mode) noexcept |
Combines two friction values into a coefficient of friction. More... | |
float | combine_restitution (float a, float b, restitution_combine_mode mode) noexcept |
Combines two restitution values into a coefficient of restitution. More... | |
template<class T > | |
T | number_density (T c) |
Calculates the number density of a substance. More... | |
template<class T , class S > | |
constexpr void | solve_spring (T &x, T &v, const T &xt, S z, S w, S dt) noexcept |
Solves a numeric spring using the implicit Euler method. More... | |
Physics.
|
strong |
Collider types.
Enumerator | |
---|---|
plane | Plane collider. |
sphere | Sphere collider. |
box | Box collider. |
capsule | Capsule collider. |
mesh | Mesh collider. |
Definition at line 30 of file collider-type.hpp.
|
strong |
Specifies how coefficients of friction should be calculated.
A coefficient of friction is calculated from two collider material friction values (a
and b
).
Enumerator | |
---|---|
average | Coefficient of friction is calculated as |
minimum | Coefficient of friction is calculated as
|
multiply | |
maximum |
Definition at line 32 of file friction.hpp.
|
strong |
Specifies how coefficients of restitution should be calculated.
A coefficient of restitution is calculated from two collider material restitution values (a
and b
).
Enumerator | |
---|---|
average | Coefficient of restitution is calculated as |
minimum | Coefficient of restitution is calculated as
|
multiply | |
maximum |
Definition at line 32 of file restitution.hpp.
|
noexcept |
Combines two friction values into a coefficient of friction.
a | First friction value. |
b | Second friction value. |
mode | Friction combine mode. |
a
and b
. Definition at line 25 of file friction.cpp.
|
noexcept |
Combines two restitution values into a coefficient of restitution.
a | First restitution value. |
b | Second restitution value. |
mode | Restitution combine mode. |
a
and b
. Definition at line 25 of file restitution.cpp.
|
inlineconstexprnoexcept |
Converts frequency to angular frequency.
T | Scalar type. |
f | Frequency, in hertz. |
Definition at line 37 of file frequency.hpp.
T physics::number_density | ( | T | c | ) |
Calculates the number density of a substance.
c | Molar concentration, in mol/m-3. |
Definition at line 36 of file number-density.hpp.
|
inlineconstexprnoexcept |
Converts angular frequency to frequency.
T | Scalar type. |
w | Angular frequency, in radians per second. |
Definition at line 52 of file frequency.hpp.
|
inlineconstexprnoexcept |
Converts angular frequency to oscillation period.
T | Scalar type. |
w | Angular frequency, in radians per second. |
Definition at line 82 of file frequency.hpp.
|
inlineconstexprnoexcept |
Converts oscillation period to angular frequency.
T | Scalar type. |
t | Oscillation period, in seconds. |
Definition at line 67 of file frequency.hpp.
|
constexprnoexcept |
Solves a numeric spring using the implicit Euler method.
T | Value type. |
S | Scalar type. |
[in,out] | x | Current value of the spring. |
[in,out] | v | Current velocity of the spring. |
[in] | xt | Target value of the spring. |
[in] | z | Damping ratio of the spring, which can be undamped (0 ), underdamped (< 1 ), critically damped (1 ), or overdamped (> 1 ). |
[in] | w | Angular frequency of the spring oscillation, in radians per second. |
[in] | dt | Delta time, in seconds. |
Definition at line 42 of file spring.hpp.