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

载具系统:移动注册 + 命令处理 + 更新。 更多...

#include <VehicleSystem.h>

静态 Public 成员函数

static void registerMobility (IVehicleMobility *mobility)
 注册移动模型实现;同名替换。
 
static IVehicleMobility * findMobility (const std::string &name)
 按名字取移动模型;未注册返回 nullptr。
 
static int mobilityCount ()
 已注册移动模型数量。
 
static void registerDriver (IVehicleDriver *driver)
 注册驾驶者实现;同名替换。
 
static IVehicleDriver * findDriver (const std::string &name)
 按名字取驾驶者;未注册返回 nullptr。
 
static int driverCount ()
 已注册驾驶者数量。
 
static void setPlayerControls (int playerId, const PlayerControl &control)
 写入某玩家的控制状态(游戏每帧填充)。
 
static const PlayerControl * playerControls (int playerId)
 取某玩家的控制状态;未设置返回 nullptr。
 
static void setEventSink (VehicleEventSink sink)
 注册事件汇(替换旧的;传 nullptr 清空)。
 
static void update (VehicleEntity &v, float dt)
 每帧推进:命令 → 输入 → 移动模型。自动瞄准由 Vehicle 模块完成。
 
static void processOrders (VehicleEntity &v, float dt)
 处理命令队列:把队首命令转成 v.input()。
 
static eve::Result< void > pushOrder (VehicleEntity &v, const VehicleOrder &order)
 追加一条命令;Move/AttackMove 会清空旧命令(RTS 习惯)。
 
static void clearOrders (VehicleEntity &v)
 清空命令队列。
 
static const VehicleOrder * currentOrder (VehicleEntity &v)
 当前命令;无命令返回 nullptr。
 
static float steerToward (VehicleEntity &v, float targetHeadingDeg)
 按角度差生成转向输入(-1..1)。
 
static bool enterSeat (VehicleEntity &v, int seatIndex, int playerId)
 座位:进入 / 离开 / 按玩家找座位。
 
static bool exitSeat (VehicleEntity &v, int seatIndex)
 Exit seat.
 
static int findSeatByPlayer (VehicleEntity &v, int playerId)
 Finds seat by player.
 

详细描述

载具系统:移动注册 + 命令处理 + 更新。

在文件 VehicleSystem.h 第 22 行定义.

成员函数说明

◆ clearOrders()

void eve::vehicle::VehicleSystem::clearOrders ( VehicleEntity &  v)
static

清空命令队列。

在文件 VehicleSystem.cpp 第 276 行定义.

引用了 v.

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

◆ currentOrder()

const VehicleOrder * eve::vehicle::VehicleSystem::currentOrder ( VehicleEntity &  v)
static

当前命令;无命令返回 nullptr。

返回
Borrowed nullable order owned by the vehicle's order adapter. @ownership The VehicleEntity/order adapter owns the command; callers never release it. @lifetime Valid until the next order mutation or vehicle destruction. @thread Call on the vehicle's owning simulation thread. @reentrancy Do not retain across callbacks or order mutation.

在文件 VehicleSystem.cpp 第 283 行定义.

引用了 v.

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

◆ driverCount()

int eve::vehicle::VehicleSystem::driverCount ( )
static

已注册驾驶者数量。

在文件 VehicleSystem.cpp 第 300 行定义.

◆ enterSeat()

bool eve::vehicle::VehicleSystem::enterSeat ( VehicleEntity &  v,
int  seatIndex,
int  playerId 
)
static

座位:进入 / 离开 / 按玩家找座位。

在文件 VehicleSystem.cpp 第 311 行定义.

引用了 adapter , 以及 v.

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

◆ exitSeat()

bool eve::vehicle::VehicleSystem::exitSeat ( VehicleEntity &  v,
int  seatIndex 
)
static

Exit seat.

在文件 VehicleSystem.cpp 第 317 行定义.

引用了 adapter , 以及 v.

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

◆ findDriver()

IVehicleDriver * eve::vehicle::VehicleSystem::findDriver ( const std::string &  name)
static

按名字取驾驶者;未注册返回 nullptr。

返回
Borrowed nullable implementation owned by the static registry. @ownership VehicleSystem owns only the registry entry; the provider owns the implementation. @lifetime Valid while registered and until replacement/unregister; do not retain across registry mutation. @thread Call on the Vehicle registry thread. @reentrancy The lookup does not invoke provider callbacks or mutate the registry.

在文件 VehicleSystem.cpp 第 295 行定义.

引用了 name.

◆ findMobility()

IVehicleMobility * eve::vehicle::VehicleSystem::findMobility ( const std::string &  name)
static

按名字取移动模型;未注册返回 nullptr。

返回
Borrowed nullable implementation owned by the static registry. @ownership VehicleSystem owns only the registry entry; the provider owns the implementation. @lifetime Valid while registered and until replacement/unregister; do not retain across registry mutation. @thread Call on the Vehicle registry thread. @reentrancy The lookup does not invoke provider callbacks or mutate the registry.

在文件 VehicleSystem.cpp 第 191 行定义.

引用了 name.

被这些函数引用 update().

◆ findSeatByPlayer()

int eve::vehicle::VehicleSystem::findSeatByPlayer ( VehicleEntity &  v,
int  playerId 
)
static

Finds seat by player.

在文件 VehicleSystem.cpp 第 323 行定义.

引用了 v.

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

◆ mobilityCount()

int eve::vehicle::VehicleSystem::mobilityCount ( )
static

已注册移动模型数量。

在文件 VehicleSystem.cpp 第 196 行定义.

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

◆ playerControls()

const PlayerControl * eve::vehicle::VehicleSystem::playerControls ( int  playerId)
static

取某玩家的控制状态;未设置返回 nullptr。

返回
Borrowed nullable state owned by VehicleSystem's control store. @ownership VehicleSystem owns the stored control record; callers must not delete it. @lifetime Valid until the next write for this player or registry reset. @thread Call on the vehicle input thread. @reentrancy The lookup does not invoke callbacks; copy the state before re-entering input code.

在文件 VehicleSystem.cpp 第 306 行定义.

◆ processOrders()

void eve::vehicle::VehicleSystem::processOrders ( VehicleEntity &  v,
float  dt 
)
static

◆ pushOrder()

eve::Result< void > eve::vehicle::VehicleSystem::pushOrder ( VehicleEntity &  v,
const VehicleOrder &  order 
)
static

◆ registerDriver()

void eve::vehicle::VehicleSystem::registerDriver ( IVehicleDriver *  driver)
static

注册驾驶者实现;同名替换。

在文件 VehicleSystem.cpp 第 290 行定义.

引用了 eve::vehicle::IVehicleDriver::name().

◆ registerMobility()

void eve::vehicle::VehicleSystem::registerMobility ( IVehicleMobility *  mobility)
static

注册移动模型实现;同名替换。

在文件 VehicleSystem.cpp 第 186 行定义.

引用了 eve::vehicle::IVehicleMobility::name().

被这些函数引用 eve::vehicle::VehiclePhysics::registerBuiltinMobility() , 以及 eve::vehicle::Vehicle::registerMobility().

◆ setEventSink()

void eve::vehicle::VehicleSystem::setEventSink ( VehicleEventSink  sink)
static

注册事件汇(替换旧的;传 nullptr 清空)。

在文件 VehicleSystem.cpp 第 198 行定义.

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

◆ setPlayerControls()

void eve::vehicle::VehicleSystem::setPlayerControls ( int  playerId,
const PlayerControl &  control 
)
static

写入某玩家的控制状态(游戏每帧填充)。

在文件 VehicleSystem.cpp 第 302 行定义.

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

◆ steerToward()

float eve::vehicle::VehicleSystem::steerToward ( VehicleEntity &  v,
float  targetHeadingDeg 
)
static

按角度差生成转向输入(-1..1)。

在文件 VehicleSystem.cpp 第 285 行定义.

引用了 v.

被这些函数引用 processOrders().

◆ update()

void eve::vehicle::VehicleSystem::update ( VehicleEntity &  v,
float  dt 
)
static

每帧推进:命令 → 输入 → 移动模型。自动瞄准由 Vehicle 模块完成。

在文件 VehicleSystem.cpp 第 200 行定义.

引用了 findMobility(), eve::vehicle::VehicleDefinition::mobility, processOrders(), eve::vehicle::IVehicleMobility::update() , 以及 v.

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


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