载入中...
搜索中...
未找到
ForceBatch.h
浏览该文件的文档.
1#pragma once
2#include <span>
3#include <vector>
4#include "common/Export.h"
8
9namespace eve::physics {
27public:
28 ForceBatch(const ForceBatch&) = delete;
29 ForceBatch& operator=(const ForceBatch&) = delete;
31 ForceBatch(ForceBatch&& other) noexcept;
33 ForceBatch& operator=(ForceBatch&& other) noexcept;
38 [[nodiscard]] static Result<ForceBatch> prepare(World& world, std::span<const ForceLoad> loads);
43 [[nodiscard]] static Result<ForceBatch> prepare(World3D& world, std::span<const ForceLoad> loads);
48 [[nodiscard]] Result<ForceReceipt> commit(World& world, const SimulationStep& step);
53 [[nodiscard]] Result<ForceReceipt> commit(World3D& world, const SimulationStep& step);
54
55private:
56 ForceBatch(PhysicsWorldHandle world, bool spatial, std::span<const ForceLoad> loads);
57 PhysicsWorldHandle world_;
58 bool spatial_ = false, consumed_ = false;
59 std::vector<ForceLoad> loads_;
60};
61} // namespace eve::physics
eve::action::ActionSpatialBinding spatial
#define EVENGINE_API_WORLD
Definition Export.h:109
float step
Definition TreeMesh.cpp:451
Move-only operation result carrying either a value or Status.
Definition Result.h:176
Move-only, single-use collection of validated force requests. @ownership Owns values and handles only...
Definition ForceBatch.h:26
ForceBatch(const ForceBatch &)=delete
ForceBatch & operator=(const ForceBatch &)=delete
Box3D rigid-body world. Script coordinates are meters (Box3D native), unlike 2D World which uses pixe...
Definition World3D.h:47
Box2D world wrapper (2D physics) with pixel-space coordinates. Handles stepping, gravity,...
Definition World.h:44
Optional physics backend for vehicle mobility and body attach.
Definition Climbing.h:36
One deterministic fixed-step emitted by SimulationClock.
Definition Time.h:158
Owned SI load request: world point in meters, force in N, free torque in Nm. @lifetime The link is ob...
Definition ForceBatch.h:13
Owning world-space SI vector; 2D uses XY with Z exactly zero.
Definition ForceModels.h:12