VehiclePhysics public API. 更多...
#include <VehiclePhysics.h>
静态 Public 成员函数 | |
| static VehiclePhysicsStatus | attach2D (VehicleEntity *v, eve::physics::World *world) |
| Attach a 2D dynamic body when physics is in the build. | |
| static VehiclePhysicsStatus | attach3D (VehicleEntity *v, eve::physics::World3D *world, float heightY) |
| Attach a 3D dynamic body when physics is in the build. | |
| static VehiclePhysicsStatus | detach (VehicleEntity *v) |
| Destroy attached bodies if any. | |
| static bool | isAttached (VehicleEntity *v) |
| Whether the entity has a live, resolvable physics body. | |
| static float | height (VehicleEntity *v) |
| 3D body height, or 0 when no 3D body is attached. | |
| static VehiclePhysicsStatus | tryWheelMove (VehicleEntity &v, float dt) |
| Step wheel/ship mobility from an attached body. | |
| static Result< VehiclePhysicsStatus > | submitWheelStep (VehicleEntity &v, const SimulationStep &step) |
| Submit top-down 2D or ray-suspension 3D wheel forces for an exact positive fixed step; no solver advancement. | |
| static Result< VehiclePhysicsStatus > | synchronizeWheelState (VehicleEntity &v) |
| Publish wheel candidates only after their physics step succeeds; no force submission. | |
| static void | syncTrackFromBody (VehicleEntity &v) |
| Copy attached body pose into motion for tracked vehicles. | |
| static VehiclePhysicsStatus | tryTrackApply (VehicleEntity &v, float headingRad, float speed) |
| Apply tracked heading/speed to an attached body. | |
| static void | registerBuiltinMobility () |
| Register suspension mobility when physics is in the build. | |
详细描述
VehiclePhysics public API.
在文件 VehiclePhysics.h 第 33 行定义.
成员函数说明
◆ attach2D()
|
static |
Attach a 2D dynamic body when physics is in the build.
在文件 VehiclePhysics.cpp 第 149 行定义.
引用了 eve::vehicle::Applied, b, detach(), eve::physics::PhysicsLink::fromBody(), link, eve::vehicle::VehicleDefinition::radius, eve::vehicle::Unavailable , 以及 v.
◆ attach3D()
|
static |
Attach a 3D dynamic body when physics is in the build.
在文件 VehiclePhysics.cpp 第 173 行定义.
引用了 eve::vehicle::Applied, b, detach(), eve::physics::PhysicsLink::fromBody(), link, eve::vehicle::VehicleDefinition::radius, eve::physics::Shape3D::setFilterBits(), shape, eve::vehicle::VehicleDefinition::suspension, eve::vehicle::Unavailable, v , 以及 eve::vehicle::SuspensionConfig::wheels.
◆ detach()
|
static |
Destroy attached bodies if any.
在文件 VehiclePhysics.cpp 第 201 行定义.
引用了 eve::vehicle::Applied, eve::vehicle::Unavailable , 以及 v.
被这些函数引用 attach2D(), attach3D() , 以及 eve::vehicle::Vehicle::detachPhysics().
◆ height()
|
static |
3D body height, or 0 when no 3D body is attached.
在文件 VehiclePhysics.cpp 第 215 行定义.
被这些函数引用 eve::vehicle::Vehicle::getHeight().
◆ isAttached()
|
static |
Whether the entity has a live, resolvable physics body.
在文件 VehiclePhysics.cpp 第 211 行定义.
引用了 v.
被这些函数引用 eve::vehicle::Vehicle::getPhysicsSpace() , 以及 eve::vehicle::Vehicle::hasPhysics().
◆ registerBuiltinMobility()
|
static |
Register suspension mobility when physics is in the build.
在文件 VehiclePhysics.cpp 第 314 行定义.
◆ submitWheelStep()
|
static |
Submit top-down 2D or ray-suspension 3D wheel forces for an exact positive fixed step; no solver advancement.
- 返回
- Pending, Applied for an already completed identical submission, Unavailable without a body, or structured failure. Spatial contacts include equal/opposite dynamic-ground forces. @ownership The binding owns candidate state and a read-only physics completion receipt. @thread Simulation owner only, outside callbacks; non-reentrant.
Failed preparation changes no wheel state or body. Synchronize a completed step before the next submit. @cost Per-wheel sampling and O(n log n) force preparation; one opaque pending operation per attached vehicle.
在文件 VehiclePhysics.cpp 第 269 行定义.
引用了 binding, body, step, eve::vehicle::tire_detail::submit2D(), eve::vehicle::tire_detail::submit3D(), eve::Result< T >::success(), eve::vehicle::Unavailable , 以及 v.
被这些函数引用 tryWheelMove().
◆ synchronizeWheelState()
|
static |
Publish wheel candidates only after their physics step succeeds; no force submission.
- 返回
- Pending, Applied, Cancelled, or Unavailable. Stale body links cancel unpublished candidates. @thread Simulation owner only; no callbacks. Completed wheel state belongs to the ECS component.
在文件 VehiclePhysics.cpp 第 277 行定义.
引用了 binding, eve::vehicle::Cancelled, eve::Result< T >::success(), eve::vehicle::tire_detail::synchronize(), eve::vehicle::Unavailable , 以及 v.
被这些函数引用 tryWheelMove().
◆ syncTrackFromBody()
|
static |
Copy attached body pose into motion for tracked vehicles.
在文件 VehiclePhysics.cpp 第 287 行定义.
◆ tryTrackApply()
|
static |
Apply tracked heading/speed to an attached body.
在文件 VehiclePhysics.cpp 第 299 行定义.
引用了 eve::vehicle::Applied, b, binding, eve::vehicle::Unavailable , 以及 v.
◆ tryWheelMove()
|
static |
Step wheel/ship mobility from an attached body.
在文件 VehiclePhysics.cpp 第 221 行定义.
引用了 eve::vehicle::Applied, b, binding, dt, duration, eve::Duration::fromSeconds(), eve::vehicle::Pending, qw, qx, qy, qz, eve::vehicle::Rejected, submitWheelStep(), synchronizeWheelState(), eve::vehicle::Unavailable, v , 以及 value.
该类的文档由以下文件生成:
- src/modules/vehicle/VehiclePhysics.h
- src/modules/vehicle/VehiclePhysics.cpp
- src/modules/vehicle/VehiclePhysicsAbsent.cpp