Composed mechanical assembly owned by a World3D. 更多...
#include <Mechanism3D.h>
Public 类型 | |
| enum class | Kind { CrankSlider , Shaft , Ratchet } |
| Assembly kind. 更多... | |
Public 成员函数 | |
| Mechanism3D (const Mechanism3D &)=delete | |
| Mechanism3D & | operator= (const Mechanism3D &)=delete |
| int | getId () const |
| Stable world-local identifier. | |
| std::string | getKind () const |
| Kind name: "crankSlider", "shaft", or "ratchet". | |
| World3D * | getWorld () const |
| Owning world, or null after invalidation. | |
| bool | isValid () const |
| Whether the assembly and its primary joints are still live. | |
| Joint3D * | getDriveJoint () const |
| Primary revolute (crank / shaft / ratchet wheel). | |
| Joint3D * | getCrankPinJoint () const |
| Crank-to-rod revolute, or null for shaft/ratchet. | |
| Joint3D * | getSliderPinJoint () const |
| Rod-to-slider revolute, or null for shaft/ratchet. | |
| Joint3D * | getSliderJoint () const |
| Frame-to-slider prismatic, or null for shaft/ratchet. | |
| float | getDriveAngle () const |
| Current drive revolute angle in radians (shaft/crank/ratchet). | |
| float | getSliderTranslation () const |
| Current slider translation in metres (crank-slider only). | |
| float | getSpinSpeed () const |
| Relative spin speed along the drive axis in radians/second. | |
| void | setDrive (float speed, float maxTorque) |
| Enables a continuous drive motor on the primary revolute. | |
| void | clearDrive () |
| Disables the continuous drive motor. | |
| bool | isDriveEnabled () const |
| Whether a continuous drive motor is configured. | |
| void | setRatchetDirection (int direction) |
| Sets ratchet freewheel direction. | |
| int | getRatchetDirection () const |
| Current ratchet freewheel direction (+1 or -1). | |
| void | setRatchetEngagementTorque (float torque) |
| Sets reverse-lock torque for ratchet engagement. | |
| float | getRatchetEngagementTorque () const |
| Current ratchet engagement torque in newton-metres. | |
| void | destroy () |
| Destroys owned joints and invalidates this wrapper. | |
| void | invalidate () |
| Internal invalidation used by world teardown. | |
| void | syncBeforeStep () |
| Internal: applies ratchet lock / drive before a solver step. | |
| ~Mechanism3D () | |
友元 | |
| class | World3D |
详细描述
Composed mechanical assembly owned by a World3D.
Builds crank-slider, shaft, and ratchet mechanisms from Joint3D primitives. Ratchet one-way locking is applied automatically during World3D::step.
@ownership World3D owns the mechanism and the joints it creates. Borrowed Body3D inputs are never retained as caller ownership. @lifetime Valid until Mechanism3D::destroy(), World3D::destroy(), or any dependent body/joint invalidation. @thread Call on the owning physics thread. @reentrancy Does not invoke callbacks.
在文件 Mechanism3D.h 第 25 行定义.
成员枚举类型说明
◆ Kind
|
strong |
构造及析构函数说明
◆ Mechanism3D()
|
delete |
◆ ~Mechanism3D()
| eve::physics::Mechanism3D::~Mechanism3D | ( | ) |
在文件 Mechanism3D.cpp 第 28 行定义.
引用了 destroy.
成员函数说明
◆ clearDrive()
| void eve::physics::Mechanism3D::clearDrive | ( | ) |
Disables the continuous drive motor.
在文件 Mechanism3D.cpp 第 92 行定义.
◆ destroy()
| void eve::physics::Mechanism3D::destroy | ( | ) |
Destroys owned joints and invalidates this wrapper.
在文件 Mechanism3D.cpp 第 141 行定义.
◆ getCrankPinJoint()
|
inline |
Crank-to-rod revolute, or null for shaft/ratchet.
- 返回
- Borrowed joint owned by the parent World3D, or null when unused/invalid. @ownership World3D owns the joint; this mechanism only borrows it. @lifetime Valid until Mechanism3D::destroy(), Joint3D::destroy(), or World3D::destroy().
在文件 Mechanism3D.h 第 55 行定义.
◆ getDriveAngle()
| float eve::physics::Mechanism3D::getDriveAngle | ( | ) | const |
Current drive revolute angle in radians (shaft/crank/ratchet).
在文件 Mechanism3D.cpp 第 53 行定义.
◆ getDriveJoint()
|
inline |
Primary revolute (crank / shaft / ratchet wheel).
- 返回
- Borrowed joint owned by the parent World3D, or null after invalidation. @ownership World3D owns the joint; this mechanism only borrows it. @lifetime Valid until Mechanism3D::destroy(), Joint3D::destroy(), or World3D::destroy().
在文件 Mechanism3D.h 第 48 行定义.
◆ getId()
|
inline |
Stable world-local identifier.
在文件 Mechanism3D.h 第 34 行定义.
◆ getKind()
| std::string eve::physics::Mechanism3D::getKind | ( | ) | const |
Kind name: "crankSlider", "shaft", or "ratchet".
在文件 Mechanism3D.cpp 第 30 行定义.
◆ getRatchetDirection()
|
inline |
Current ratchet freewheel direction (+1 or -1).
在文件 Mechanism3D.h 第 96 行定义.
◆ getRatchetEngagementTorque()
|
inline |
Current ratchet engagement torque in newton-metres.
在文件 Mechanism3D.h 第 103 行定义.
◆ getSliderJoint()
|
inline |
Frame-to-slider prismatic, or null for shaft/ratchet.
- 返回
- Borrowed joint owned by the parent World3D, or null when unused/invalid. @ownership World3D owns the joint; this mechanism only borrows it. @lifetime Valid until Mechanism3D::destroy(), Joint3D::destroy(), or World3D::destroy().
在文件 Mechanism3D.h 第 69 行定义.
◆ getSliderPinJoint()
|
inline |
Rod-to-slider revolute, or null for shaft/ratchet.
- 返回
- Borrowed joint owned by the parent World3D, or null when unused/invalid. @ownership World3D owns the joint; this mechanism only borrows it. @lifetime Valid until Mechanism3D::destroy(), Joint3D::destroy(), or World3D::destroy().
在文件 Mechanism3D.h 第 62 行定义.
◆ getSliderTranslation()
| float eve::physics::Mechanism3D::getSliderTranslation | ( | ) | const |
Current slider translation in metres (crank-slider only).
在文件 Mechanism3D.cpp 第 58 行定义.
◆ getSpinSpeed()
| float eve::physics::Mechanism3D::getSpinSpeed | ( | ) | const |
Relative spin speed along the drive axis in radians/second.
在文件 Mechanism3D.cpp 第 74 行定义.
◆ getWorld()
|
inline |
Owning world, or null after invalidation.
在文件 Mechanism3D.h 第 38 行定义.
◆ invalidate()
| void eve::physics::Mechanism3D::invalidate | ( | ) |
Internal invalidation used by world teardown.
在文件 Mechanism3D.cpp 第 132 行定义.
◆ isDriveEnabled()
|
inline |
Whether a continuous drive motor is configured.
在文件 Mechanism3D.h 第 88 行定义.
◆ isValid()
| bool eve::physics::Mechanism3D::isValid | ( | ) | const |
Whether the assembly and its primary joints are still live.
在文件 Mechanism3D.cpp 第 39 行定义.
◆ operator=()
|
delete |
◆ setDrive()
| void eve::physics::Mechanism3D::setDrive | ( | float | speed, |
| float | maxTorque | ||
| ) |
Enables a continuous drive motor on the primary revolute.
- 参数
-
speed Target speed in radians/second (sign is absolute; ratchet remaps it onto the freewheel direction). maxTorque Maximum motor torque in newton-metres.
在文件 Mechanism3D.cpp 第 79 行定义.
◆ setRatchetDirection()
| void eve::physics::Mechanism3D::setRatchetDirection | ( | int | direction | ) |
Sets ratchet freewheel direction.
- 参数
-
direction +1 or -1 along the joint axis; other values throw.
在文件 Mechanism3D.cpp 第 102 行定义.
引用了 direction.
◆ setRatchetEngagementTorque()
| void eve::physics::Mechanism3D::setRatchetEngagementTorque | ( | float | torque | ) |
Sets reverse-lock torque for ratchet engagement.
- 参数
-
torque Maximum opposing torque in newton-metres.
在文件 Mechanism3D.cpp 第 109 行定义.
◆ syncBeforeStep()
| void eve::physics::Mechanism3D::syncBeforeStep | ( | ) |
Internal: applies ratchet lock / drive before a solver step.
在文件 Mechanism3D.cpp 第 117 行定义.
友元及相关函数文档
◆ World3D
|
friend |
在文件 Mechanism3D.h 第 115 行定义.
该类的文档由以下文件生成:
- src/modules/physics/Mechanism3D.h
- src/modules/physics/Mechanism3D.cpp