载入中...
搜索中...
未找到
FractureRecipe.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
16enum class FractureMode : std::uint8_t {
19 Radial = 2,
20 Planar = 3,
21};
22
30 static constexpr std::string_view SchemaId = "physics:fracture-recipe";
31 static constexpr std::uint32_t SchemaVersion = 1;
32
33 FractureMode mode = FractureMode::UniformVoronoi;
34 int siteCountMin = 4;
35 int siteCountMax = 4;
36 int clusterCount = 2;
37 float clusterRadius = 0.35f;
38 int radialPlanes = 1;
39 int radialSpokes = 4;
40 std::vector<float> planeNormals; // xyz triples
41 std::vector<float> planeOffsets;
43 std::string randomStreamName = "destruction.fracture";
44 std::uint64_t seed = 1;
45 float defaultStrainThreshold = 1.f;
46 float defaultDensity = 1.f;
47 float defaultFriction = 0.4f;
48 float defaultRestitution = 0.05f;
50 float minimumThickness = 0.05f;
52 int maximumBones = 256;
53
55 [[nodiscard("check fracture recipe validation")]] eve::Result<void> validate() const;
57 [[nodiscard("check fracture recipe encoding")]] eve::Result<eve::Value> toValue() const;
59 [[nodiscard]] static eve::schema::SchemaDefinition schemaDefinition();
61 [[nodiscard("check fracture recipe schema registration")]] static eve::Result<void> ensureSchemaRegistered();
62 [[nodiscard("check fracture recipe decoding")]]
64 static eve::Result<FractureRecipe> fromValue(const eve::Value& value);
65};
66
67} // namespace eve::physics
double value
#define EVENGINE_API_DOMAINS
Definition Export.h:110
std::uint32_t seed
Definition PointSet.cpp:807
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
FractureMode
Fracture pattern used when cooking a geometry collection.
Versioned cook recipe for Chaos-style pre-fracture (schema v1).
std::vector< float > planeOffsets
std::vector< float > planeNormals
Versioned runtime schema for a JSON object.
Definition SchemaTypes.h:93