载入中...
搜索中...
未找到
GeometryCollectionAsset.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>
10#include <string_view>
11#include <vector>
12
13namespace eve::physics {
14
17 float halfExtentX = 0.5f;
18 float halfExtentY = 0.5f;
19 float halfExtentZ = 0.5f;
20 float localX = 0.f;
21 float localY = 0.f;
22 float localZ = 0.f;
23 float mass = 1.f;
24 float density = 1.f;
25 float friction = 0.4f;
26 float restitution = 0.05f;
27 bool anchoredDefault = false;
29 int clusterId = 0;
31 int fractureLevel = 0;
32};
33
36 int boneA = 0;
37 int boneB = 0;
38 float strainThreshold = 1.f;
39};
40
49 static constexpr std::string_view SchemaId = "physics:geometry-collection";
50 static constexpr std::uint32_t SchemaVersion = 2;
51 static constexpr std::uint32_t SchemaVersionV1 = 1;
52
53 std::vector<GeometryCollectionBone> bones;
54 std::vector<GeometryCollectionEdge> edges;
55
57 [[nodiscard("check geometry-collection asset validation")]] eve::Result<void> validate() const;
59 [[nodiscard("check geometry-collection asset encoding")]] eve::Result<eve::Value> toValue() const;
61 [[nodiscard]] static eve::schema::SchemaDefinition schemaDefinition();
63 [[nodiscard("check geometry-collection schema registration")]] static eve::Result<void> ensureSchemaRegistered();
69 [[nodiscard("check geometry-collection asset decoding")]]
71
73 [[nodiscard("check welded-boxes fixture construction")]]
74 static eve::Result<GeometryCollectionAsset> makeWeldedBoxesFixture(float strainThreshold = 1.f);
75
82 [[nodiscard("check cluster-pillar fixture construction")]]
83 static eve::Result<GeometryCollectionAsset> makeClusterPillarFixture(float interClusterStrain = 0.8f);
84};
85
86} // namespace eve::physics
double value
#define EVENGINE_API_DOMAINS
Definition Export.h:110
Move-only, checked operation results for the common layer.
double restitution
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
Immutable cooked/authored geometry-collection asset.
std::vector< GeometryCollectionEdge > edges
std::vector< GeometryCollectionBone > bones
One pre-authored leaf bone (box collision proxy) inside a geometry collection.
One undirected structural edge with a strain break threshold.
Versioned runtime schema for a JSON object.
Definition SchemaTypes.h:93