载入中...
搜索中...
未找到
GeometryCollectionSnapshot.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4#include "common/Result.h"
5#include "common/Value.h"
7
8#include <cstdint>
9#include <string_view>
10#include <vector>
11
12namespace eve::physics {
13
14class GeometryCollectionInstance;
15
29 static constexpr std::string_view SchemaId = "physics:geometry-collection-instance";
30 static constexpr std::uint32_t SchemaVersion = 1;
31
33 struct BoneSnapshot {
34 std::uint8_t state = 0;
35 bool anchored = false;
36 int clusterId = 0;
37 int fractureLevel = 0;
38 float halfExtentX = 0.5f;
39 float halfExtentY = 0.5f;
40 float halfExtentZ = 0.5f;
41 };
43 struct EdgeSnapshot {
44 int boneA = 0;
45 int boneB = 0;
46 float strainThreshold = 1.f;
47 float accumulatedStrain = 0.f;
48 bool broken = false;
49 };
50
51 float originX = 0.f;
52 float originY = 0.f;
53 float originZ = 0.f;
54 std::int64_t lastTick = 0;
55 std::uint64_t sleepBatchRevision = 0;
56 std::vector<BoneSnapshot> bones;
57 std::vector<EdgeSnapshot> edges;
58
60 [[nodiscard("check geometry-collection instance snapshot validation")]] eve::Result<void> validate() const;
62 [[nodiscard("check geometry-collection instance snapshot encoding")]] eve::Result<eve::Value> toValue() const;
64 [[nodiscard]] static eve::schema::SchemaDefinition schemaDefinition();
66 [[nodiscard("check geometry-collection instance schema registration")]] static eve::Result<void>
67 ensureSchemaRegistered();
69 [[nodiscard("check geometry-collection instance snapshot decoding")]]
71};
72
73} // namespace eve::physics
double value
#define EVENGINE_API_DOMAINS
Definition Export.h:110
Move-only, checked operation results for the common layer.
Owning, renderer-independent dynamic values.
Move-only operation result carrying either a value or Status.
Definition Result.h:155
The canonical owning dynamic value used by data-facing protocols.
Definition Value.h:31
Optional physics backend for vehicle mobility and body attach.
Definition Climbing.h:36
Persistent runtime snapshot for one geometry-collection instance.
Versioned runtime schema for a JSON object.
Definition SchemaTypes.h:93