载入中...
搜索中...
未找到
eve::vehicle::VehiclePhysics类 参考

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()

VehiclePhysicsStatus eve::vehicle::VehiclePhysics::attach2D ( VehicleEntity *  v,
eve::physics::World *  world 
)
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.

被这些函数引用 eve::vehicle::Vehicle::attachPhysics2D().

◆ attach3D()

◆ detach()

VehiclePhysicsStatus eve::vehicle::VehiclePhysics::detach ( VehicleEntity *  v)
static

Destroy attached bodies if any.

在文件 VehiclePhysics.cpp 第 201 行定义.

引用了 eve::vehicle::Applied, eve::vehicle::Unavailable , 以及 v.

被这些函数引用 attach2D(), attach3D() , 以及 eve::vehicle::Vehicle::detachPhysics().

◆ height()

float eve::vehicle::VehiclePhysics::height ( VehicleEntity *  v)
static

3D body height, or 0 when no 3D body is attached.

在文件 VehiclePhysics.cpp 第 215 行定义.

引用了 binding, body , 以及 v.

被这些函数引用 eve::vehicle::Vehicle::getHeight().

◆ isAttached()

bool eve::vehicle::VehiclePhysics::isAttached ( VehicleEntity *  v)
static

Whether the entity has a live, resolvable physics body.

在文件 VehiclePhysics.cpp 第 211 行定义.

引用了 v.

被这些函数引用 eve::vehicle::Vehicle::getPhysicsSpace() , 以及 eve::vehicle::Vehicle::hasPhysics().

◆ registerBuiltinMobility()

void eve::vehicle::VehiclePhysics::registerBuiltinMobility ( )
static

Register suspension mobility when physics is in the build.

在文件 VehiclePhysics.cpp 第 314 行定义.

引用了 eve::vehicle::VehicleSystem::registerMobility().

◆ submitWheelStep()

Result< VehiclePhysicsStatus > eve::vehicle::VehiclePhysics::submitWheelStep ( VehicleEntity &  v,
const SimulationStep &  step 
)
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()

Result< VehiclePhysicsStatus > eve::vehicle::VehiclePhysics::synchronizeWheelState ( VehicleEntity &  v)
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()

void eve::vehicle::VehiclePhysics::syncTrackFromBody ( VehicleEntity &  v)
static

Copy attached body pose into motion for tracked vehicles.

在文件 VehiclePhysics.cpp 第 287 行定义.

引用了 b, binding , 以及 v.

◆ tryTrackApply()

VehiclePhysicsStatus eve::vehicle::VehiclePhysics::tryTrackApply ( VehicleEntity &  v,
float  headingRad,
float  speed 
)
static

Apply tracked heading/speed to an attached body.

在文件 VehiclePhysics.cpp 第 299 行定义.

引用了 eve::vehicle::Applied, b, binding, eve::vehicle::Unavailable , 以及 v.

◆ tryWheelMove()

VehiclePhysicsStatus eve::vehicle::VehiclePhysics::tryWheelMove ( VehicleEntity &  v,
float  dt 
)
static

该类的文档由以下文件生成: