|
Nudge Physics
A single file, header-only 3D physics library
|
Helper functions to calculate the inertia vector of a body (to feed add_compound(...)), or its inverse (to feed c->bodies.properties[body].inertia_inverse directly) More...
Functions | |
| void | nudge::calculate_box_inertia (float result[3], float mass, float hsizex, float hsizey, float hsizez, const float comOffset[3]=NULL) |
| void | nudge::calculate_sphere_inertia (float result[3], float mass, float radius, const float comOffset[3]=NULL, bool hollow=false) |
| void | nudge::calculate_cylinder_inertia (float result[3], float mass, float radius, float halfHeight, AxisEnum upAxis=AXIS_Y, const float comOffset[3]=NULL) |
| void | nudge::calculate_capsule_inertia (float result[3], float mass, float radius, float halfCylinderHeight, AxisEnum upAxis=AXIS_Y, const float comOffset[3]=NULL) |
| void | nudge::calculate_torus_inertia (float result[3], float mass, float majorRadius, float minorRadius, AxisEnum upAxis=AXIS_Y, const float comOffset[3]=NULL) |
| void | nudge::calculate_hollow_cylinder_inertia (float result[3], float mass, float R, float r, float halfHeight, AxisEnum upAxis=AXIS_Y, const float comOffset[3]=NULL) |
| void | nudge::calculate_cone_inertia (float result[3], float mass, float radius, float halfHeight, AxisEnum upAxis=AXIS_Y, const float comOffset[3]=NULL) |
| void | nudge::calculate_box_inertia_inverse (float result[3], float mass, float hsizex, float hsizey, float hsizez, const float comOffset[3]=NULL) |
| void | nudge::calculate_sphere_inertia_inverse (float result[3], float mass, float radius, const float comOffset[3]=NULL, bool hollow=false) |
| void | nudge::calculate_cylinder_inertia_inverse (float result[3], float mass, float radius, float halfHeight, AxisEnum upAxis=AXIS_Y, const float comOffset[3]=NULL) |
| void | nudge::calculate_capsule_inertia_inverse (float result[3], float mass, float radius, float halfCylinderHeight, AxisEnum upAxis=AXIS_Y, const float comOffset[3]=NULL) |
| void | nudge::calculate_torus_inertia_inverse (float result[3], float mass, float majorRadius, float minorRadius, AxisEnum upAxis=AXIS_Y, const float comOffset[3]=NULL) |
| void | nudge::calculate_hollow_cylinder_inertia_inverse (float result[3], float mass, float R, float r, float halfHeight, AxisEnum upAxis=AXIS_Y, const float comOffset[3]=NULL) |
| void | nudge::calculate_cone_inertia_inverse (float result[3], float mass, float radius, float halfHeight, AxisEnum upAxis=AXIS_Y, const float comOffset[3]=NULL) |
Helper functions to calculate the inertia vector of a body (to feed add_compound(...)), or its inverse (to feed c->bodies.properties[body].inertia_inverse directly)
| void nudge::calculate_box_inertia | ( | float | result[3], |
| float | mass, | ||
| float | hsizex, | ||
| float | hsizey, | ||
| float | hsizez, | ||
| const float | comOffset[3] = NULL |
||
| ) |
| void nudge::calculate_sphere_inertia | ( | float | result[3], |
| float | mass, | ||
| float | radius, | ||
| const float | comOffset[3] = NULL, |
||
| bool | hollow = false |
||
| ) |
| void nudge::calculate_cylinder_inertia | ( | float | result[3], |
| float | mass, | ||
| float | radius, | ||
| float | halfHeight, | ||
| AxisEnum | upAxis = AXIS_Y, |
||
| const float | comOffset[3] = NULL |
||
| ) |
| void nudge::calculate_capsule_inertia | ( | float | result[3], |
| float | mass, | ||
| float | radius, | ||
| float | halfCylinderHeight, | ||
| AxisEnum | upAxis = AXIS_Y, |
||
| const float | comOffset[3] = NULL |
||
| ) |
| void nudge::calculate_torus_inertia | ( | float | result[3], |
| float | mass, | ||
| float | majorRadius, | ||
| float | minorRadius, | ||
| AxisEnum | upAxis = AXIS_Y, |
||
| const float | comOffset[3] = NULL |
||
| ) |
| void nudge::calculate_hollow_cylinder_inertia | ( | float | result[3], |
| float | mass, | ||
| float | R, | ||
| float | r, | ||
| float | halfHeight, | ||
| AxisEnum | upAxis = AXIS_Y, |
||
| const float | comOffset[3] = NULL |
||
| ) |
| void nudge::calculate_cone_inertia | ( | float | result[3], |
| float | mass, | ||
| float | radius, | ||
| float | halfHeight, | ||
| AxisEnum | upAxis = AXIS_Y, |
||
| const float | comOffset[3] = NULL |
||
| ) |
| void nudge::calculate_box_inertia_inverse | ( | float | result[3], |
| float | mass, | ||
| float | hsizex, | ||
| float | hsizey, | ||
| float | hsizez, | ||
| const float | comOffset[3] = NULL |
||
| ) |
| void nudge::calculate_sphere_inertia_inverse | ( | float | result[3], |
| float | mass, | ||
| float | radius, | ||
| const float | comOffset[3] = NULL, |
||
| bool | hollow = false |
||
| ) |
| void nudge::calculate_cylinder_inertia_inverse | ( | float | result[3], |
| float | mass, | ||
| float | radius, | ||
| float | halfHeight, | ||
| AxisEnum | upAxis = AXIS_Y, |
||
| const float | comOffset[3] = NULL |
||
| ) |
| void nudge::calculate_capsule_inertia_inverse | ( | float | result[3], |
| float | mass, | ||
| float | radius, | ||
| float | halfCylinderHeight, | ||
| AxisEnum | upAxis = AXIS_Y, |
||
| const float | comOffset[3] = NULL |
||
| ) |
| void nudge::calculate_torus_inertia_inverse | ( | float | result[3], |
| float | mass, | ||
| float | majorRadius, | ||
| float | minorRadius, | ||
| AxisEnum | upAxis = AXIS_Y, |
||
| const float | comOffset[3] = NULL |
||
| ) |
| void nudge::calculate_hollow_cylinder_inertia_inverse | ( | float | result[3], |
| float | mass, | ||
| float | R, | ||
| float | r, | ||
| float | halfHeight, | ||
| AxisEnum | upAxis = AXIS_Y, |
||
| const float | comOffset[3] = NULL |
||
| ) |