Script-facing Box3D joint owned by a World3D. 更多...
#include <Joint3D.h>
Public 类型 | |
| enum class | Kind { Distance , Revolute , Prismatic , Spherical , Wheel , Weld , Motor , Parallel , Filter } |
| Supported joint geometry. 更多... | |
Public 成员函数 | |
| Joint3D (World3D *world, Body3D *bodyA, Body3D *bodyB, b3JointId jointId, PhysicsJointHandle runtimeHandle, Kind kind, int id) | |
| Internal wrapper constructor; use World3D::new*Joint. | |
| ~Joint3D () | |
| Joint3D (const Joint3D &)=delete | |
| Joint3D & | operator= (const Joint3D &)=delete |
| int | getId () const |
| Stable world-local identifier. | |
| PhysicsJointHandle | runtimeHandle () const noexcept |
| Process-local generation-qualified handle owned by World3D. | |
| std::string | getKind () const |
| Joint kind string for script/debug ("distance", "revolute", …, "filter"). | |
| int | getBodyAId () const |
| Stable ID of attached body A, or -1 after invalidation. | |
| int | getBodyBId () const |
| Stable ID of attached body B, or -1 after invalidation. | |
| World3D * | getWorld () const noexcept |
| Owning world, or null after joint destruction. | |
| void | setCollideConnected (bool collide) |
| Enables or disables collision between the attached bodies. | |
| bool | getCollideConnected () const |
| Whether attached bodies may collide. | |
| void | setForceThreshold (float threshold) |
| Sets the force threshold that emits a joint-stress event, in newtons. | |
| float | getForceThreshold () const |
| Current force event threshold in newtons. | |
| void | setTorqueThreshold (float threshold) |
| Sets the torque threshold that emits a joint-stress event, in newton-metres. | |
| float | getTorqueThreshold () const |
| Current torque event threshold in newton-metres. | |
| float | getConstraintForceX () const |
| Current world-space constraint force X in newtons. | |
| float | getConstraintForceY () const |
| Current world-space constraint force Y in newtons. | |
| float | getConstraintForceZ () const |
| Current world-space constraint force Z in newtons. | |
| float | getConstraintTorqueX () const |
| Current world-space constraint torque X in newton-metres. | |
| float | getConstraintTorqueY () const |
| Current world-space constraint torque Y in newton-metres. | |
| float | getConstraintTorqueZ () const |
| Current world-space constraint torque Z in newton-metres. | |
| float | getLinearSeparation () const |
| Current inadmissible linear separation error in metres. | |
| float | getAngularSeparation () const |
| Current inadmissible angular separation error in radians. | |
| void | setDistanceLength (float length) |
| Changes distance-joint rest length in metres. | |
| float | getDistanceLength () const |
| Distance-joint rest length in metres. | |
| float | getDistanceCurrentLength () const |
| Current anchor-to-anchor distance in metres. | |
| void | setDistanceSpring (bool enabled, float hertz, float dampingRatio) |
| Configures a distance spring; hertz and damping must be non-negative. | |
| void | setDistanceLimits (bool enabled, float minimum, float maximum) |
| Configures optional distance limits in metres. | |
| void | setDistanceMotor (bool enabled, float speed, float maxForce) |
| Configures the distance motor in metres/second and newtons. | |
| void | setRevoluteSpring (bool enabled, float targetAngle, float hertz, float dampingRatio) |
| Configures a revolute angular spring in radians. | |
| void | setRevoluteLimits (bool enabled, float lower, float upper) |
| Configures revolute angular limits in radians. | |
| void | setRevoluteMotor (bool enabled, float speed, float maxTorque) |
| Configures the revolute motor in radians/second and newton-metres. | |
| float | getRevoluteAngle () const |
| Current revolute angle in radians. | |
| float | getRevoluteMotorTorque () const |
| Current revolute motor torque in newton-metres. | |
| void | setPrismaticSpring (bool enabled, float targetTranslation, float hertz, float dampingRatio) |
| Configures a prismatic linear spring and target translation. | |
| void | setPrismaticLimits (bool enabled, float lower, float upper) |
| Configures prismatic translation limits in metres. | |
| void | setPrismaticMotor (bool enabled, float speed, float maxForce) |
| Configures a prismatic motor in metres/second and newtons. | |
| float | getPrismaticTranslation () const |
| Current prismatic translation in metres. | |
| float | getPrismaticSpeed () const |
| Current prismatic translation speed in metres/second. | |
| float | getPrismaticMotorForce () const |
| Current prismatic motor force in newtons. | |
| void | setSphericalConeLimit (bool enabled, float angle) |
| Enables a spherical cone limit in radians, within [0, pi]. | |
| void | setSphericalTwistLimits (bool enabled, float lower, float upper) |
| Enables spherical twist limits in radians. | |
| void | setSphericalMotor (bool enabled, float velocityX, float velocityY, float velocityZ, float maxTorque) |
| Configures spherical motor velocity and maximum torque. | |
| float | getSphericalConeAngle () const |
| Current spherical cone angle in radians. | |
| float | getSphericalTwistAngle () const |
| Current spherical twist angle in radians. | |
| void | setWheelSuspension (bool enabled, float hertz, float dampingRatio) |
| Configures wheel suspension spring stiffness and damping. | |
| void | setWheelSuspensionLimits (bool enabled, float lower, float upper) |
| Configures wheel suspension travel limits in metres. | |
| void | setWheelSpinMotor (bool enabled, float speed, float maxTorque) |
| Configures wheel spin motor speed and maximum torque. | |
| void | setWheelSteering (bool enabled, float targetAngle, float hertz, float dampingRatio, float maxTorque) |
| Configures steering target, stiffness, damping and maximum torque. | |
| void | setWheelSteeringLimits (bool enabled, float lower, float upper) |
| Configures steering angular limits in radians. | |
| float | getWheelSpinSpeed () const |
| Current wheel spin speed in radians/second. | |
| float | getWheelSpinTorque () const |
| Current wheel spin motor torque in newton-metres. | |
| float | getWheelSteeringAngle () const |
| Current wheel steering angle in radians. | |
| float | getWheelSteeringTorque () const |
| Current steering torque in newton-metres. | |
| void | setWeldLinearSpring (float hertz, float dampingRatio) |
| Configures weld linear spring stiffness and damping; 0 hertz is rigid. | |
| void | setWeldAngularSpring (float hertz, float dampingRatio) |
| Configures weld angular spring stiffness and damping; 0 hertz is rigid. | |
| float | getWeldLinearHertz () const |
| Weld linear stiffness in Hertz. | |
| float | getWeldLinearDampingRatio () const |
| Weld linear damping ratio. | |
| float | getWeldAngularHertz () const |
| Weld angular stiffness in Hertz. | |
| float | getWeldAngularDampingRatio () const |
| Weld angular damping ratio. | |
| void | setMotorLinearVelocity (float vx, float vy, float vz) |
| Sets motor-joint relative linear velocity in metres/second. | |
| void | setMotorAngularVelocity (float wx, float wy, float wz) |
| Sets motor-joint relative angular velocity in radians/second. | |
| void | setMotorVelocityLimits (float maxForce, float maxTorque) |
| Sets motor velocity force/torque limits. | |
| void | setMotorLinearSpring (float hertz, float dampingRatio, float maxForce) |
| Configures motor linear position spring. | |
| void | setMotorAngularSpring (float hertz, float dampingRatio, float maxTorque) |
| Configures motor angular position spring. | |
| float | getMotorLinearVelocityX () const |
| Desired motor linear velocity X in metres/second. | |
| float | getMotorLinearVelocityY () const |
| Desired motor linear velocity Y in metres/second. | |
| float | getMotorLinearVelocityZ () const |
| Desired motor linear velocity Z in metres/second. | |
| float | getMotorAngularVelocityX () const |
| Desired motor angular velocity X in radians/second. | |
| float | getMotorAngularVelocityY () const |
| Desired motor angular velocity Y in radians/second. | |
| float | getMotorAngularVelocityZ () const |
| Desired motor angular velocity Z in radians/second. | |
| void | setParallelSpring (float hertz, float dampingRatio, float maxTorque) |
| Configures parallel-joint spring stiffness, damping and torque cap. | |
| float | getParallelHertz () const |
| Parallel spring stiffness in Hertz. | |
| float | getParallelDampingRatio () const |
| Parallel spring damping ratio. | |
| float | getParallelMaxTorque () const |
| Parallel maximum spring torque in newton-metres. | |
| void | destroy () |
| Destroys the backend joint and invalidates this wrapper. | |
| bool | isValid () const |
| Whether the backend joint still exists. | |
| void | invalidate () |
| Internal invalidation used by body/world destruction. | |
| b3JointId | raw () const |
| Internal raw Box3D identifier. | |
友元 | |
| struct | WorldSnapshotAccess |
| class | Body3D |
| class | World3D |
详细描述
成员枚举类型说明
◆ Kind
|
strong |
构造及析构函数说明
◆ Joint3D() [1/2]
| eve::physics::Joint3D::Joint3D | ( | World3D * | world, |
| Body3D * | bodyA, | ||
| Body3D * | bodyB, | ||
| b3JointId | jointId, | ||
| PhysicsJointHandle | runtimeHandle, | ||
| Kind | kind, | ||
| int | id | ||
| ) |
Internal wrapper constructor; use World3D::new*Joint.
在文件 Joint3D.cpp 第 25 行定义.
◆ ~Joint3D()
| eve::physics::Joint3D::~Joint3D | ( | ) |
在文件 Joint3D.cpp 第 35 行定义.
引用了 destroy().
◆ Joint3D() [2/2]
|
delete |
成员函数说明
◆ destroy()
| void eve::physics::Joint3D::destroy | ( | ) |
Destroys the backend joint and invalidates this wrapper.
在文件 Joint3D.cpp 第 48 行定义.
引用了 eve::physics::World3D::forgetJoint(), invalidate() , 以及 isValid().
被这些函数引用 ~Joint3D().
◆ getAngularSeparation()
| float eve::physics::Joint3D::getAngularSeparation | ( | ) | const |
◆ getBodyAId()
| int eve::physics::Joint3D::getBodyAId | ( | ) | const |
Stable ID of attached body A, or -1 after invalidation.
在文件 Joint3D.cpp 第 69 行定义.
◆ getBodyBId()
| int eve::physics::Joint3D::getBodyBId | ( | ) | const |
Stable ID of attached body B, or -1 after invalidation.
在文件 Joint3D.cpp 第 70 行定义.
◆ getCollideConnected()
| bool eve::physics::Joint3D::getCollideConnected | ( | ) | const |
◆ getConstraintForceX()
| float eve::physics::Joint3D::getConstraintForceX | ( | ) | const |
Current world-space constraint force X in newtons.
◆ getConstraintForceY()
| float eve::physics::Joint3D::getConstraintForceY | ( | ) | const |
Current world-space constraint force Y in newtons.
◆ getConstraintForceZ()
| float eve::physics::Joint3D::getConstraintForceZ | ( | ) | const |
Current world-space constraint force Z in newtons.
◆ getConstraintTorqueX()
| float eve::physics::Joint3D::getConstraintTorqueX | ( | ) | const |
Current world-space constraint torque X in newton-metres.
◆ getConstraintTorqueY()
| float eve::physics::Joint3D::getConstraintTorqueY | ( | ) | const |
Current world-space constraint torque Y in newton-metres.
◆ getConstraintTorqueZ()
| float eve::physics::Joint3D::getConstraintTorqueZ | ( | ) | const |
Current world-space constraint torque Z in newton-metres.
◆ getDistanceCurrentLength()
| float eve::physics::Joint3D::getDistanceCurrentLength | ( | ) | const |
◆ getDistanceLength()
| float eve::physics::Joint3D::getDistanceLength | ( | ) | const |
◆ getForceThreshold()
| float eve::physics::Joint3D::getForceThreshold | ( | ) | const |
◆ getId()
|
inline |
◆ getKind()
| std::string eve::physics::Joint3D::getKind | ( | ) | const |
◆ getLinearSeparation()
| float eve::physics::Joint3D::getLinearSeparation | ( | ) | const |
◆ getMotorAngularVelocityX()
| float eve::physics::Joint3D::getMotorAngularVelocityX | ( | ) | const |
◆ getMotorAngularVelocityY()
| float eve::physics::Joint3D::getMotorAngularVelocityY | ( | ) | const |
◆ getMotorAngularVelocityZ()
| float eve::physics::Joint3D::getMotorAngularVelocityZ | ( | ) | const |
◆ getMotorLinearVelocityX()
| float eve::physics::Joint3D::getMotorLinearVelocityX | ( | ) | const |
◆ getMotorLinearVelocityY()
| float eve::physics::Joint3D::getMotorLinearVelocityY | ( | ) | const |
◆ getMotorLinearVelocityZ()
| float eve::physics::Joint3D::getMotorLinearVelocityZ | ( | ) | const |
◆ getParallelDampingRatio()
| float eve::physics::Joint3D::getParallelDampingRatio | ( | ) | const |
◆ getParallelHertz()
| float eve::physics::Joint3D::getParallelHertz | ( | ) | const |
◆ getParallelMaxTorque()
| float eve::physics::Joint3D::getParallelMaxTorque | ( | ) | const |
◆ getPrismaticMotorForce()
| float eve::physics::Joint3D::getPrismaticMotorForce | ( | ) | const |
◆ getPrismaticSpeed()
| float eve::physics::Joint3D::getPrismaticSpeed | ( | ) | const |
◆ getPrismaticTranslation()
| float eve::physics::Joint3D::getPrismaticTranslation | ( | ) | const |
◆ getRevoluteAngle()
| float eve::physics::Joint3D::getRevoluteAngle | ( | ) | const |
◆ getRevoluteMotorTorque()
| float eve::physics::Joint3D::getRevoluteMotorTorque | ( | ) | const |
◆ getSphericalConeAngle()
| float eve::physics::Joint3D::getSphericalConeAngle | ( | ) | const |
◆ getSphericalTwistAngle()
| float eve::physics::Joint3D::getSphericalTwistAngle | ( | ) | const |
◆ getTorqueThreshold()
| float eve::physics::Joint3D::getTorqueThreshold | ( | ) | const |
◆ getWeldAngularDampingRatio()
| float eve::physics::Joint3D::getWeldAngularDampingRatio | ( | ) | const |
◆ getWeldAngularHertz()
| float eve::physics::Joint3D::getWeldAngularHertz | ( | ) | const |
◆ getWeldLinearDampingRatio()
| float eve::physics::Joint3D::getWeldLinearDampingRatio | ( | ) | const |
◆ getWeldLinearHertz()
| float eve::physics::Joint3D::getWeldLinearHertz | ( | ) | const |
◆ getWheelSpinSpeed()
| float eve::physics::Joint3D::getWheelSpinSpeed | ( | ) | const |
◆ getWheelSpinTorque()
| float eve::physics::Joint3D::getWheelSpinTorque | ( | ) | const |
◆ getWheelSteeringAngle()
| float eve::physics::Joint3D::getWheelSteeringAngle | ( | ) | const |
◆ getWheelSteeringTorque()
| float eve::physics::Joint3D::getWheelSteeringTorque | ( | ) | const |
◆ getWorld()
|
inlinenoexcept |
◆ invalidate()
| void eve::physics::Joint3D::invalidate | ( | ) |
Internal invalidation used by body/world destruction.
在文件 Joint3D.cpp 第 39 行定义.
引用了 eve::physics::World3D::forgetJoint() , 以及 eve::RuntimeHandle< PhysicsJointHandleTag >::invalid().
被这些函数引用 destroy().
◆ isValid()
| bool eve::physics::Joint3D::isValid | ( | ) | const |
Whether the backend joint still exists.
在文件 Joint3D.cpp 第 37 行定义.
被这些函数引用 destroy(), getAngularSeparation(), getCollideConnected(), getForceThreshold(), getLinearSeparation(), getTorqueThreshold(), setCollideConnected(), setForceThreshold() , 以及 setTorqueThreshold().
◆ operator=()
◆ raw()
|
inline |
◆ runtimeHandle()
|
inlinenoexcept |
Process-local generation-qualified handle owned by World3D.
被这些函数引用 eve::physics::World3D::forgetJoint().
◆ setCollideConnected()
| void eve::physics::Joint3D::setCollideConnected | ( | bool | collide | ) |
◆ setDistanceLength()
| void eve::physics::Joint3D::setDistanceLength | ( | float | length | ) |
◆ setDistanceLimits()
| void eve::physics::Joint3D::setDistanceLimits | ( | bool | enabled, |
| float | minimum, | ||
| float | maximum | ||
| ) |
◆ setDistanceMotor()
| void eve::physics::Joint3D::setDistanceMotor | ( | bool | enabled, |
| float | speed, | ||
| float | maxForce | ||
| ) |
Configures the distance motor in metres/second and newtons.
在文件 Joint3D.cpp 第 149 行定义.
◆ setDistanceSpring()
| void eve::physics::Joint3D::setDistanceSpring | ( | bool | enabled, |
| float | hertz, | ||
| float | dampingRatio | ||
| ) |
Configures a distance spring; hertz and damping must be non-negative.
在文件 Joint3D.cpp 第 132 行定义.
◆ setForceThreshold()
| void eve::physics::Joint3D::setForceThreshold | ( | float | threshold | ) |
Sets the force threshold that emits a joint-stress event, in newtons.
在文件 Joint3D.cpp 第 80 行定义.
引用了 isValid().
◆ setMotorAngularSpring()
| void eve::physics::Joint3D::setMotorAngularSpring | ( | float | hertz, |
| float | dampingRatio, | ||
| float | maxTorque | ||
| ) |
◆ setMotorAngularVelocity()
| void eve::physics::Joint3D::setMotorAngularVelocity | ( | float | wx, |
| float | wy, | ||
| float | wz | ||
| ) |
◆ setMotorLinearSpring()
| void eve::physics::Joint3D::setMotorLinearSpring | ( | float | hertz, |
| float | dampingRatio, | ||
| float | maxForce | ||
| ) |
◆ setMotorLinearVelocity()
| void eve::physics::Joint3D::setMotorLinearVelocity | ( | float | vx, |
| float | vy, | ||
| float | vz | ||
| ) |
◆ setMotorVelocityLimits()
| void eve::physics::Joint3D::setMotorVelocityLimits | ( | float | maxForce, |
| float | maxTorque | ||
| ) |
◆ setParallelSpring()
| void eve::physics::Joint3D::setParallelSpring | ( | float | hertz, |
| float | dampingRatio, | ||
| float | maxTorque | ||
| ) |
Configures parallel-joint spring stiffness, damping and torque cap.
在文件 Joint3D.cpp 第 433 行定义.
引用了 Parallel.
◆ setPrismaticLimits()
| void eve::physics::Joint3D::setPrismaticLimits | ( | bool | enabled, |
| float | lower, | ||
| float | upper | ||
| ) |
Configures prismatic translation limits in metres.
在文件 Joint3D.cpp 第 206 行定义.
◆ setPrismaticMotor()
| void eve::physics::Joint3D::setPrismaticMotor | ( | bool | enabled, |
| float | speed, | ||
| float | maxForce | ||
| ) |
Configures a prismatic motor in metres/second and newtons.
在文件 Joint3D.cpp 第 215 行定义.
◆ setPrismaticSpring()
| void eve::physics::Joint3D::setPrismaticSpring | ( | bool | enabled, |
| float | targetTranslation, | ||
| float | hertz, | ||
| float | dampingRatio | ||
| ) |
Configures a prismatic linear spring and target translation.
在文件 Joint3D.cpp 第 195 行定义.
◆ setRevoluteLimits()
| void eve::physics::Joint3D::setRevoluteLimits | ( | bool | enabled, |
| float | lower, | ||
| float | upper | ||
| ) |
Configures revolute angular limits in radians.
在文件 Joint3D.cpp 第 169 行定义.
◆ setRevoluteMotor()
| void eve::physics::Joint3D::setRevoluteMotor | ( | bool | enabled, |
| float | speed, | ||
| float | maxTorque | ||
| ) |
Configures the revolute motor in radians/second and newton-metres.
在文件 Joint3D.cpp 第 178 行定义.
◆ setRevoluteSpring()
| void eve::physics::Joint3D::setRevoluteSpring | ( | bool | enabled, |
| float | targetAngle, | ||
| float | hertz, | ||
| float | dampingRatio | ||
| ) |
Configures a revolute angular spring in radians.
在文件 Joint3D.cpp 第 158 行定义.
◆ setSphericalConeLimit()
| void eve::physics::Joint3D::setSphericalConeLimit | ( | bool | enabled, |
| float | angle | ||
| ) |
◆ setSphericalMotor()
| void eve::physics::Joint3D::setSphericalMotor | ( | bool | enabled, |
| float | velocityX, | ||
| float | velocityY, | ||
| float | velocityZ, | ||
| float | maxTorque | ||
| ) |
Configures spherical motor velocity and maximum torque.
在文件 Joint3D.cpp 第 254 行定义.
◆ setSphericalTwistLimits()
| void eve::physics::Joint3D::setSphericalTwistLimits | ( | bool | enabled, |
| float | lower, | ||
| float | upper | ||
| ) |
Enables spherical twist limits in radians.
在文件 Joint3D.cpp 第 244 行定义.
◆ setTorqueThreshold()
| void eve::physics::Joint3D::setTorqueThreshold | ( | float | threshold | ) |
Sets the torque threshold that emits a joint-stress event, in newton-metres.
在文件 Joint3D.cpp 第 88 行定义.
引用了 isValid().
◆ setWeldAngularSpring()
| void eve::physics::Joint3D::setWeldAngularSpring | ( | float | hertz, |
| float | dampingRatio | ||
| ) |
Configures weld angular spring stiffness and damping; 0 hertz is rigid.
在文件 Joint3D.cpp 第 345 行定义.
引用了 Weld.
◆ setWeldLinearSpring()
| void eve::physics::Joint3D::setWeldLinearSpring | ( | float | hertz, |
| float | dampingRatio | ||
| ) |
Configures weld linear spring stiffness and damping; 0 hertz is rigid.
在文件 Joint3D.cpp 第 338 行定义.
引用了 Weld.
◆ setWheelSpinMotor()
| void eve::physics::Joint3D::setWheelSpinMotor | ( | bool | enabled, |
| float | speed, | ||
| float | maxTorque | ||
| ) |
Configures wheel spin motor speed and maximum torque.
在文件 Joint3D.cpp 第 291 行定义.
◆ setWheelSteering()
| void eve::physics::Joint3D::setWheelSteering | ( | bool | enabled, |
| float | targetAngle, | ||
| float | hertz, | ||
| float | dampingRatio, | ||
| float | maxTorque | ||
| ) |
Configures steering target, stiffness, damping and maximum torque.
在文件 Joint3D.cpp 第 299 行定义.
◆ setWheelSteeringLimits()
| void eve::physics::Joint3D::setWheelSteeringLimits | ( | bool | enabled, |
| float | lower, | ||
| float | upper | ||
| ) |
Configures steering angular limits in radians.
在文件 Joint3D.cpp 第 312 行定义.
◆ setWheelSuspension()
| void eve::physics::Joint3D::setWheelSuspension | ( | bool | enabled, |
| float | hertz, | ||
| float | dampingRatio | ||
| ) |
Configures wheel suspension spring stiffness and damping.
在文件 Joint3D.cpp 第 274 行定义.
◆ setWheelSuspensionLimits()
| void eve::physics::Joint3D::setWheelSuspensionLimits | ( | bool | enabled, |
| float | lower, | ||
| float | upper | ||
| ) |
Configures wheel suspension travel limits in metres.
在文件 Joint3D.cpp 第 282 行定义.
友元及相关函数文档
◆ Body3D
◆ World3D
◆ WorldSnapshotAccess
|
friend |
该类的文档由以下文件生成:
- src/modules/physics/Joint3D.h
- src/modules/physics/Joint3D.cpp