载入中...
搜索中...
未找到
ScenePhysicsPlacement.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
8
9#include <cstdint>
10#include <memory>
11#include <string>
12#include <vector>
13
14namespace eve::scene_editor {
15
18
21
24
27
44
49 double halfExtentX = 0.5;
50 double halfExtentY = 0.5;
51 double halfExtentZ = 0.5;
52 bool selected = false;
54 std::vector<float> convexVertices;
56 std::vector<PhysicsPlacementCollider> colliders;
57 std::uint64_t layerBits = 1;
58 std::vector<std::string> tags;
59 bool enabled = true;
60 bool locked = false;
62};
63
66 std::uint64_t includedLayerBits = ~std::uint64_t{0};
67 std::uint64_t excludedLayerBits = 0;
68 std::vector<std::string> requiredTags;
69 bool excludeDisabled = true;
70 bool excludeLocked = true;
71 bool useBounds = false;
72 double minimumX = 0.0;
73 double minimumY = 0.0;
74 double minimumZ = 0.0;
75 double maximumX = 0.0;
76 double maximumY = 0.0;
77 double maximumZ = 0.0;
78};
79
108
117
121 double x = 0, y = 0, z = 0;
122 double normalX = 0, normalY = 0, normalZ = 0;
123 double separation = 0;
124};
127 std::uint64_t tick = 0;
128 bool colliding = false;
129 bool settled = false;
130 bool surfaceAligned = false;
131 double surfaceNormalX = 0.0;
132 double surfaceNormalY = 1.0;
133 double surfaceNormalZ = 0.0;
134 std::vector<PhysicsPlacementObject> objects;
135 std::vector<PhysicsPlacementContact> contacts;
136 bool contactsComplete = false;
138};
139
149public:
154
158
160 [[nodiscard]] std::unique_ptr<editor::IEditorSimulationBackend> cloneForPreview() const override;
162 [[nodiscard]] editing::Result<void> step(std::uint64_t tick, double fixedDelta) override;
164 [[nodiscard]] editing::Result<std::vector<editor::SimulationObjectSample>> capture() const override;
165
167 [[nodiscard]] editing::Result<void> setHandlePosition(double x, double y, double z);
169 [[nodiscard]] editing::Result<void> setHandleRotation(double x, double y, double z);
171 [[nodiscard]] editing::Result<void> setHandleScale(double x, double y, double z);
173 [[nodiscard]] editing::Result<void> alignHandleToSurface(double fromX, double fromY, double fromZ, double toX,
174 double toY, double toZ, double offset = 0.0);
176 [[nodiscard]] editing::Result<PhysicsPlacementFrame> placementFrame() const;
183 [[nodiscard]] editing::Result<PhysicsPlacementFrame> relationFrame() const;
185 [[nodiscard]] editing::Revision sourceRevision() const noexcept;
186
187private:
188 struct Impl;
189 explicit ScenePhysicsPlacementBackend(std::unique_ptr<Impl> impl);
190 std::unique_ptr<Impl> impl_;
191};
192
193} // namespace eve::scene_editor
double z
double y
double x
void * impl
#define EVENGINE_API_EDITORS
Definition Export.h:112
const GltfImportRequest & request
size_t offset
SimulationTick tick
float step
Definition TreeMesh.cpp:451
Move-only operation result carrying either a value or Status.
Definition Result.h:176
UUID-backed identifier adapter for legacy textual boundaries.
Definition Identity.h:313
Cloneable backend boundary for physics/crowd/fluid editor simulation previews.
Real Box3D-backed, non-destructive simulation backend for scene placement.
ScenePhysicsPlacementBackend(const ScenePhysicsPlacementBackend &)=delete
~ScenePhysicsPlacementBackend() override
Scene physics placement backend.
ScenePhysicsPlacementBackend & operator=(const ScenePhysicsPlacementBackend &)=delete
std::uint64_t Revision
PhysicsPlacementMode
Interaction policy used by one isolated placement candidate.
PhysicsPlacementColliderSource
Provenance used when selecting preview colliders.
PhysicsPlacementColliderPolicy
Policy deciding which admitted collider sources participate in preview.
PhysicsPlacementShape
Collision approximation admitted into the private preview world.
Serializable transform exchanged across the scene editing boundary.
Host-supplied filters used before objects enter the private preview world.
One local-space shape in a possibly compound placement collider.
Owning contact evidence, with normal directed from subject toward reference.
Captured placement state suitable for drawing and final transaction planning.
std::vector< PhysicsPlacementObject > objects
std::vector< PhysicsPlacementContact > contacts
Scene object and collision approximation admitted into an isolated placement preview.
scene_editing::SceneTransformValue transform
std::vector< PhysicsPlacementCollider > colliders
Owning request used to construct one isolated placement candidate.
std::vector< PhysicsPlacementObject > objects
Deterministic policy for collision-aware scene placement.