载入中...
搜索中...
未找到
TerrainLoadGravity.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
5#include "common/Result.h"
6
7namespace eve::physics {
8class Body3D;
9
12public:
14 bool isMonitoring() const { return monitoring_; }
16 bool isActivationScheduled() const { return activationScheduled_; }
18 bool isCompleted() const { return completed_; }
20 float getDelayElapsed() const { return delayElapsed_; }
21
22private:
25 float);
26 bool monitoring_ = false;
27 bool activationScheduled_ = false;
28 bool completed_ = false;
29 float delayElapsed_ = 0.f;
30 float gravityScale_ = 1.f;
31};
32
42[[nodiscard]] EVENGINE_API_WORLD Result<void> beginTerrainLoadGravity(TerrainLoadGravityState* state, Body3D* body,
43 bool terrainFound);
44
56[[nodiscard]] EVENGINE_API_WORLD Result<bool> advanceTerrainLoadGravity(TerrainLoadGravityState* state, Body3D* body,
57 bool terrainLoaded, float deltaSeconds,
58 float activationDelay);
59}
#define EVENGINE_API_WORLD
Definition Export.h:109
Move-only, checked operation results for the common layer.
std::string body
Move-only operation result carrying either a value or Status.
Definition Result.h:155
3D rigid body (Box3D) in meter-space coordinates (+Y up by convention). Owned by a World3D; create pr...
Definition Body3D.h:24
Caller-owned state for Pcg-style rigid-body activation after terrain loading.
bool isCompleted() const
Whether gravity restoration and the activation notification completed.
friend EVENGINE_API_WORLD Result< void > beginTerrainLoadGravity(TerrainLoadGravityState *, Body3D *, bool)
Begin monitoring a body when a containing terrain scene exists.
bool isMonitoring() const
Whether a containing terrain was found and activation is being monitored.
bool isActivationScheduled() const
Whether the post-load delay has been scheduled.
float getDelayElapsed() const
Elapsed seconds since the first loaded observation.
friend EVENGINE_API_WORLD Result< bool > advanceTerrainLoadGravity(TerrainLoadGravityState *, Body3D *, bool, float, float)
Advance terrain-load waiting and restore gravity after the configured delay.
Optional physics backend for vehicle mobility and body attach.
Definition Climbing.h:36
Result< void > beginTerrainLoadGravity(TerrainLoadGravityState *state, Body3D *body, bool terrainFound)
Begin monitoring a body when a containing terrain scene exists.
Result< bool > advanceTerrainLoadGravity(TerrainLoadGravityState *state, Body3D *body, bool terrainLoaded, float deltaSeconds, float activationDelay)
Advance terrain-load waiting and restore gravity after the configured delay.