|
Fx2D
A C++20 2D rigid-body physics engine
|
A named rigid body with state, material properties, geometry, and forces. More...
#include <Entity.h>
Collaboration diagram for FxEntity:Public Member Functions | |
| bool | is_sleeping () const |
| void | wake () |
| void | sleep () |
| void | tick_sleep (float dt) |
| FxEntity (const std::string &entityName) | |
| const std::string & | get_name () const |
| uint32_t | get_entity_id () const |
| void | set_entity_id (uint32_t id) |
| int32_t | broad_phase_node () const |
| void | set_broad_phase_node (int32_t node) |
| int32_t | packed_index () const |
| void | set_packed_index (int32_t index) |
| void | reset () |
| void | set_mass (const float &mass) |
| void | set_inertia () |
| void | set_inertia (const float &inertia) |
| float | mass () const |
| float | inertia () const |
| float | inv_mass () const |
| float | inv_inertia () const |
| void | set_init_pose (const FxVec3f &o_pose) |
| void | set_init_velocity (const FxVec3f &o_velocity) |
| void | enable_external_forces (bool enable) |
| void | set_visual_geometry (FxVisualShape visual) |
| void | set_collision_geometry (FxCollisionShape collision) |
| const std::shared_ptr< FxVisualShape > & | visual_geometry () const |
| const std::shared_ptr< FxCollisionShape > & | collision_geometry () const |
| void | del_visual_geometry () |
| void | del_collision_geometry () |
| const FxArray< float > & | bounding_box () const |
| bool | aabb_overlap_check (const FxEntity &other) const |
| bool | aabb_overlap_check (const std::shared_ptr< FxEntity > &other) const |
| void | apply_torque (float torque) |
| void | apply_force (const FxVec2f &force) |
| void | apply_force (const FxVec2f &force, const FxVec2f &contact_point) |
| void | apply_impulse (const FxVec2f &impulse) |
| void | apply_impulse (const FxVec2f &impulse, const FxVec2f &contact_point) |
| FxVec2f | velocity_at_world_point (const FxVec2f &position) const |
| FxVec2f | velocity_at_local_point (const FxVec2f &local_position) const |
| FxVec2fArray | velocity_at_world_point (const FxVec2fArray &position) const |
| FxVec2fArray | velocity_at_local_point (const FxVec2fArray &local_position) const |
| FxVec2f | to_world_frame (const FxVec2f &local_point) const |
| FxVec2f | to_entity_frame (const FxVec2f &world_point) const |
| FxVec3f | calc_acceleration () |
| FxVec3f | calc_acceleration (const FxVec2f &gravity) |
| FxVec3f | apply_pose_correction (const FxVec3f &delta) |
| void | step (const FxVec2f &gravity, const double &step_dt) |
| ~FxEntity () | |
Public Attributes | |
| FxVec3f | pose {0, 0, 0} |
| FxVec3f | velocity {0, 0, 0} |
| FxVec3f | prev_pose {0, 0, 0} |
| FxVec3f | prev_velocity {0, 0, 0} |
| float | elasticity = 0.1f |
| float | vel_damping = 0.0f |
| float | gravity_scale = 1.0f |
| float | static_friction = 0.0f |
| float | dynamic_friction = 0.0f |
| bool | enabled = true |
| bool | enable_ccd = false |
| bool | is_sensor = false |
| int32_t | collision_group = 0 |
| float | sleep_threshold_linear = 0.01f |
| float | sleep_threshold_angular = 0.05f |
| float | sleep_time_required = 0.5f |
A named rigid body with state, material properties, geometry, and forces.
|
explicit |
| bool FxEntity::aabb_overlap_check | ( | const FxEntity & | other | ) | const |
| bool FxEntity::aabb_overlap_check | ( | const std::shared_ptr< FxEntity > & | other | ) | const |
| void FxEntity::apply_force | ( | const FxVec2f & | force | ) |
| void FxEntity::apply_impulse | ( | const FxVec2f & | impulse | ) |
| void FxEntity::apply_torque | ( | float | torque | ) |
| const FxArray< float > & FxEntity::bounding_box | ( | ) | const |
| FxVec3f FxEntity::calc_acceleration | ( | ) |
|
inline |
| void FxEntity::enable_external_forces | ( | bool | enable | ) |
| void FxEntity::reset | ( | ) |
|
inline |
| void FxEntity::set_inertia | ( | ) |
| void FxEntity::set_inertia | ( | const float & | inertia | ) |
| void FxEntity::set_init_pose | ( | const FxVec3f & | o_pose | ) |
| void FxEntity::set_init_velocity | ( | const FxVec3f & | o_velocity | ) |
| void FxEntity::set_mass | ( | const float & | mass | ) |
|
inline |
| void FxEntity::step | ( | const FxVec2f & | gravity, |
| const double & | step_dt | ||
| ) |
| void FxEntity::tick_sleep | ( | float | dt | ) |
| FxVec2fArray FxEntity::velocity_at_local_point | ( | const FxVec2fArray & | local_position | ) | const |
| FxVec2fArray FxEntity::velocity_at_world_point | ( | const FxVec2fArray & | position | ) | const |
|
inline |