|
Fx2D
A C++20 2D rigid-body physics engine
|
A pivot joint with angular limits and motor control. More...
#include <Joints.h>
Inheritance diagram for FxRevoluteJoint:
Collaboration diagram for FxRevoluteJoint:Public Member Functions | |
| FxRevoluteJoint (const std::string &name, const std::shared_ptr< FxEntity > &e1, const std::shared_ptr< FxEntity > &e2, const FxVec2f &anchor_point, float angle_min=-3.14159f, float angle_max=3.14159f) | |
| bool | is_revolute () const override |
| void | set_theta (float angle, bool instant=true) |
| void | set_omega (float omega, bool instant=true) |
| void | set_torque (float torque) |
| float | get_theta () const |
| float | get_omega () const |
| void | set_max_torque (float max_torque) |
| float | get_max_torque () const |
| void | apply_controls (double dt) override |
Public Member Functions inherited from FxJoint | |
| FxJoint (const std::string &name, const std::shared_ptr< FxEntity > &e1, const std::shared_ptr< FxEntity > &e2) | |
| virtual | ~FxJoint ()=default |
| const std::string & | get_name () const |
| void | reset () |
| const std::shared_ptr< FxEntity > & | get_entity1 () const |
| const std::shared_ptr< FxEntity > & | get_entity2 () const |
| std::string | get_entity1_name () const |
| std::string | get_entity2_name () const |
| const std::vector< std::shared_ptr< FxConstraint > > & | get_constraints () const |
| void | set_pid (const FxVec3f &pid) |
| FxVec3f | get_pid () const |
| void | set_p (float p) |
| void | set_i (float i) |
| void | set_d (float d) |
| float | get_p () const |
| float | get_i () const |
| float | get_d () const |
| void | set_instant (bool instant) |
| bool | get_instant () const |
| void | set_effort (float effort) |
| float | get_effort () const |
| void | set_max_effort (float max_effort) |
| float | get_max_effort () const |
| void | set_control_mode (ControlMode mode) |
| ControlMode | get_control_mode () const |
| virtual bool | is_prismatic () const |
Additional Inherited Members | |
Public Attributes inherited from FxJoint | |
| bool | enabled = true |
| bool | entities_collide = false |
Protected Member Functions inherited from FxJoint | |
| void | namespace_constraints () |
| void | reset_pid_state () |
| void | wake_entities () |
| float | eval_pid (float error, double dt) |
| float | clamp_effort (float effort) const |
Protected Attributes inherited from FxJoint | |
| std::shared_ptr< FxEntity > | entity1 |
| std::shared_ptr< FxEntity > | entity2 |
| std::string | m_name |
| std::vector< std::shared_ptr< FxConstraint > > | m_constraints |
| FxVec3f | m_pid {1.0f, 0.0f, 0.0f} |
| float | m_integral = 0.0f |
| float | m_previous_error = 0.0f |
| float | m_target_effort = 0.0f |
| bool | m_instant = true |
| FxRevoluteJoint::FxRevoluteJoint | ( | const std::string & | name, |
| const std::shared_ptr< FxEntity > & | e1, | ||
| const std::shared_ptr< FxEntity > & | e2, | ||
| const FxVec2f & | anchor_point, | ||
| float | angle_min = -3.14159f, |
||
| float | angle_max = 3.14159f |
||
| ) |
|
overridevirtual |
Implements FxJoint.
| float FxRevoluteJoint::get_omega | ( | ) | const |
| float FxRevoluteJoint::get_theta | ( | ) | const |
|
inlineoverridevirtual |
|
inline |
| void FxRevoluteJoint::set_omega | ( | float | omega, |
| bool | instant = true |
||
| ) |
| void FxRevoluteJoint::set_theta | ( | float | angle, |
| bool | instant = true |
||
| ) |
| void FxRevoluteJoint::set_torque | ( | float | torque | ) |