Owning 3D transmission constraint, stepped transactionally by its World3D. @ownership Caller/VM owns wrapper; World registers an observer and invalidates it before teardown. @lifetime Body/source-joint/world destruction invalidates the wrapper; no backend pointers persist across steps. @thread All operations and destruction require the simulation owner thread, outside callbacks/World3Dstep. @reentrancy No callbacks or locks. Source references are borrowed only for construction. 更多...
#include <Coupling3D.h>
类 | |
| struct | Data |
Public 成员函数 | |
| ~Coupling3D () | |
| Releases the registration; source bodies and joints remain intact. | |
| Coupling3D (const Coupling3D &)=delete | |
| Coupling3D & | operator= (const Coupling3D &)=delete |
| bool | isValid () const noexcept |
| True while the world and all transmission sources exist. | |
| int | getId () const noexcept |
| Stable world-local transmission id, retained after invalidation. | |
| std::weak_ptr< const void > | lifetimeToken () const noexcept |
| Weak identity token for owner-thread observers; expires on release, source/world destruction or restore. @ownership Does not own the transmission. Locking the token does not extend solver or world lifetime. @thread Simulation owner only; no callbacks or reentrancy. | |
| Result< void > | setEnabled (bool enabled) |
| Enable/disable force projection while retaining phase tracking; locked/dead objects reject changes. | |
| Result< Coupling3DState > | sample () const |
| Read current coordinates and last completed impulse without advancing phase tracking. | |
| Result< void > | destroy () |
| Remove the transmission; repeated destruction succeeds, a stepping world rejects mutation. | |
静态 Public 成员函数 | |
| static Result< std::unique_ptr< Coupling3D > > | createGear (World3D &world, Joint3D &first, Joint3D &second, const GearCoupling3DSettings &settings) |
| Couple two live same-world revolute/prismatic joints with finite nonzero signed ratio. | |
| static Result< std::unique_ptr< Coupling3D > > | createPulley (World3D &world, Body3D &a, Body3D &b, const PulleyCoupling3DSettings &settings) |
| Connect distinct same-world bodies to fixed guides with positive lengths and ratio. | |
友元 | |
| class | World3D |
| struct | WorldSnapshotAccess |
详细描述
Owning 3D transmission constraint, stepped transactionally by its World3D. @ownership Caller/VM owns wrapper; World registers an observer and invalidates it before teardown. @lifetime Body/source-joint/world destruction invalidates the wrapper; no backend pointers persist across steps. @thread All operations and destruction require the simulation owner thread, outside callbacks/World3Dstep. @reentrancy No callbacks or locks. Source references are borrowed only for construction.
Explicit velocity projection precedes the native solver; positional drift uses bounded bias correction. Revolute coordinates unwrap across turns and require less than pi radians of relative rotation per step. This is a finite-step transmission model; it does not simulate tooth contact or promise bit-exact replay.
在文件 Coupling3D.h 第 50 行定义.
构造及析构函数说明
◆ ~Coupling3D()
| eve::physics::Coupling3D::~Coupling3D | ( | ) |
Releases the registration; source bodies and joints remain intact.
在文件 Coupling3D.cpp 第 119 行定义.
引用了 EV_ASSERT.
◆ Coupling3D()
|
delete |
成员函数说明
◆ createGear()
|
static |
Couple two live same-world revolute/prismatic joints with finite nonzero signed ratio.
- 返回
- Owning transmission or structured invalid/stale/locked/degenerate input failure; failure does not mutate bodies. @cost Endpoint lookup scales with world body count, plus wrapper allocation; amortize over simulation steps.
在文件 Coupling3D.cpp 第 162 行定义.
引用了 a, b, eve::physics::Box3D, d, eve::Failed, eve::Result< T >::failure(), first, eve::InvalidArgument, eve::physics::box3d::Access::jointId(), owned, eve::PreconditionViolation, second, settings, sources, eve::StaleHandle, eve::Result< T >::success(), type, eve::Unsupported, valid, eve::physics::coupling_detail::validateResponse() , 以及 eve::ui::WidgetDesc::value.
被这些函数引用 eve::physics::WorldSnapshotAccess::restoreCouplings3D().
◆ createPulley()
|
static |
Connect distinct same-world bodies to fixed guides with positive lengths and ratio.
- 返回
- Owning transmission or structured failure; at least one movable degree of freedom is required. @cost Endpoint lookup scales with world body count, plus wrapper allocation; amortize over simulation steps.
在文件 Coupling3D.cpp 第 202 行定义.
引用了 a, b, eve::physics::Box3D, d, eve::Failed, eve::Result< T >::failure(), finite, eve::InvalidArgument, owned, eve::PreconditionViolation, settings, eve::Result< T >::success(), eve::Unsupported, valid, eve::physics::coupling_detail::validateResponse() , 以及 eve::ui::WidgetDesc::value.
被这些函数引用 eve::physics::WorldSnapshotAccess::restoreCouplings3D().
◆ destroy()
| Result< void > eve::physics::Coupling3D::destroy | ( | ) |
Remove the transmission; repeated destruction succeeds, a stepping world rejects mutation.
在文件 Coupling3D.cpp 第 143 行定义.
引用了 eve::PreconditionViolation , 以及 eve::Result< T >::success().
◆ getId()
|
noexcept |
Stable world-local transmission id, retained after invalidation.
在文件 Coupling3D.cpp 第 142 行定义.
◆ isValid()
|
noexcept |
True while the world and all transmission sources exist.
在文件 Coupling3D.cpp 第 129 行定义.
被这些函数引用 setEnabled().
◆ lifetimeToken()
|
inlinenoexcept |
Weak identity token for owner-thread observers; expires on release, source/world destruction or restore. @ownership Does not own the transmission. Locking the token does not extend solver or world lifetime. @thread Simulation owner only; no callbacks or reentrancy.
在文件 Coupling3D.h 第 77 行定义.
◆ operator=()
|
delete |
◆ sample()
| Result< Coupling3DState > eve::physics::Coupling3D::sample | ( | ) | const |
Read current coordinates and last completed impulse without advancing phase tracking.
在文件 Coupling3D.cpp 第 156 行定义.
引用了 eve::Result< T >::failure(), r , 以及 eve::Result< T >::success().
◆ setEnabled()
| Result< void > eve::physics::Coupling3D::setEnabled | ( | bool | enabled | ) |
Enable/disable force projection while retaining phase tracking; locked/dead objects reject changes.
在文件 Coupling3D.cpp 第 149 行定义.
引用了 enabled, isValid(), eve::PreconditionViolation, eve::StaleHandle , 以及 eve::Result< T >::success().
友元及相关函数文档
◆ World3D
|
friend |
在文件 Coupling3D.h 第 86 行定义.
◆ WorldSnapshotAccess
|
friend |
在文件 Coupling3D.h 第 87 行定义.
该类的文档由以下文件生成:
- src/modules/physics/mechanics/Coupling3D.h
- src/modules/physics/mechanics/Coupling3D.cpp