载入中...
搜索中...
未找到
VehicleTireRuntime.h
浏览该文件的文档.
1#pragma once
2#include <memory>
3#include "common/Result.h"
4#include "common/Time.h"
6namespace eve::physics {
7class Body;
8class Body3D;
9class World;
10class World3D;
11class ForceBatch;
12struct TireModel;
13struct TireInput;
14} // namespace eve::physics
15namespace eve::vehicle {
16class VehicleEntity;
17class VehicleWheelRuntime;
18enum class VehiclePhysicsStatus : unsigned char;
19namespace tire_detail {
20// Internal optional-physics implementation; the binding owns pending state, ECS owns completed wheel state.
21// Unavailable from submissionState means there is no matching operation and preparation may proceed.
22[[nodiscard]] Result<VehiclePhysicsStatus> submissionState(const std::shared_ptr<VehicleWheelRuntime>& runtime,
23 const SimulationStep& step);
24[[nodiscard]] Result<VehiclePhysicsStatus> commit(physics::World& world, physics::ForceBatch& batch,
25 std::shared_ptr<VehicleWheelRuntime>& runtime,
26 std::vector<VehicleEntity::SuspensionState::WheelState> candidate,
27 const SimulationStep& step);
28[[nodiscard]] Result<VehiclePhysicsStatus> commit(physics::World3D& world, physics::ForceBatch& batch,
29 std::shared_ptr<VehicleWheelRuntime>& runtime,
30 std::vector<VehicleEntity::SuspensionState::WheelState> candidate,
31 const SimulationStep& step);
32[[nodiscard]] physics::TireModel model(const SuspensionConfig& config, double radius);
33void driveInputs(physics::TireInput& target, const SuspensionConfig& config, const VehicleEntity::Input& input,
34 const SuspensionWheel& wheel, std::size_t driven, double maximumSpeed, double traction);
35[[nodiscard]] Result<VehiclePhysicsStatus> submit3D(VehicleEntity& vehicle, physics::Body3D& body,
36 std::shared_ptr<VehicleWheelRuntime>& runtime,
37 const SimulationStep& step);
38
39[[nodiscard]] Result<VehiclePhysicsStatus> submit2D(VehicleEntity& vehicle, physics::Body& body,
40 std::shared_ptr<VehicleWheelRuntime>& runtime,
41 const SimulationStep& step);
42[[nodiscard]] Result<VehiclePhysicsStatus> synchronize(VehicleEntity& vehicle,
43 std::shared_ptr<VehicleWheelRuntime>& runtime);
44} // namespace tire_detail
45} // namespace eve::vehicle
LogicalId target
EvpackChunkInput input
Definition Evpack.cpp:170
double radius
Definition MeleeHit.cpp:42
std::string body
glm::mat4 model
Move-only, checked operation results for the common layer.
Common time values and an injectable deterministic simulation clock.
float step
Definition TreeMesh.cpp:451
Optional physics backend for vehicle mobility and body attach.
Definition Climbing.h:36
Result< VehiclePhysicsStatus > synchronize(VehicleEntity &vehicle, std::shared_ptr< VehicleWheelRuntime > &runtime)
Result< VehiclePhysicsStatus > submissionState(const std::shared_ptr< VehicleWheelRuntime > &runtime, const SimulationStep &step)
Result< VehiclePhysicsStatus > commit(physics::World &world, physics::ForceBatch &batch, std::shared_ptr< VehicleWheelRuntime > &runtime, std::vector< VehicleEntity::SuspensionState::WheelState > candidate, const SimulationStep &step)
Result< VehiclePhysicsStatus > submit3D(VehicleEntity &vehicle, physics::Body3D &body, std::shared_ptr< VehicleWheelRuntime > &runtime, const SimulationStep &step)
void driveInputs(physics::TireInput &target, const SuspensionConfig &config, const VehicleEntity::Input &input, const SuspensionWheel &wheel, std::size_t driven, double maximumSpeed, double traction)
Result< VehiclePhysicsStatus > submit2D(VehicleEntity &vehicle, physics::Body &body, std::shared_ptr< VehicleWheelRuntime > &runtime, const SimulationStep &step)
驾驶者接口与玩家控制状态。
VehiclePhysicsStatus
Outcome of an optional physics attach, detach, or mobility step.