|
Fx2D
A C++20 2D rigid-body physics engine
|
A sliding joint with limits and motor control. More...
#include <Joints.h>
Inheritance diagram for FxPrismaticJoint:
Collaboration diagram for FxPrismaticJoint:Public Member Functions | |
| FxPrismaticJoint (const std::string &name, const std::shared_ptr< FxEntity > &e1, const std::shared_ptr< FxEntity > &e2, const FxVec2f &local_axis, float position_min=-1000.0f, float position_max=1000.0f) | |
| bool | is_prismatic () const override |
| void | set_position (float position, bool instant=true) |
| void | set_velocity (float velocity, bool instant=true) |
| void | set_force (float force) |
| float | get_position () const |
| float | get_velocity () const |
| void | set_max_force (float max_force) |
| float | get_max_force () 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_revolute () 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 |
| FxPrismaticJoint::FxPrismaticJoint | ( | const std::string & | name, |
| const std::shared_ptr< FxEntity > & | e1, | ||
| const std::shared_ptr< FxEntity > & | e2, | ||
| const FxVec2f & | local_axis, | ||
| float | position_min = -1000.0f, |
||
| float | position_max = 1000.0f |
||
| ) |
|
overridevirtual |
Implements FxJoint.
| float FxPrismaticJoint::get_position | ( | ) | const |
| float FxPrismaticJoint::get_velocity | ( | ) | const |
|
inlineoverridevirtual |
| void FxPrismaticJoint::set_force | ( | float | force | ) |
|
inline |
| void FxPrismaticJoint::set_position | ( | float | position, |
| bool | instant = true |
||
| ) |
| void FxPrismaticJoint::set_velocity | ( | float | velocity, |
| bool | instant = true |
||
| ) |