载入中...
搜索中...
未找到
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
120 std::uint64_t tick = 0;
121 bool colliding = false;
122 bool settled = false;
123 bool surfaceAligned = false;
124 double surfaceNormalX = 0.0;
125 double surfaceNormalY = 1.0;
126 double surfaceNormalZ = 0.0;
127 std::vector<PhysicsPlacementObject> objects;
128};
129
139public:
144
148
150 [[nodiscard]] std::unique_ptr<editor::IEditorSimulationBackend> cloneForPreview() const override;
152 [[nodiscard]] editing::Result<void> step(std::uint64_t tick, double fixedDelta) override;
154 [[nodiscard]] editing::Result<std::vector<editor::SimulationObjectSample>> capture() const override;
155
157 [[nodiscard]] editing::Result<void> setHandlePosition(double x, double y, double z);
159 [[nodiscard]] editing::Result<void> setHandleRotation(double x, double y, double z);
161 [[nodiscard]] editing::Result<void> setHandleScale(double x, double y, double z);
163 [[nodiscard]] editing::Result<void> alignHandleToSurface(double fromX, double fromY, double fromZ, double toX,
164 double toY, double toZ, double offset = 0.0);
166 [[nodiscard]] editing::Result<PhysicsPlacementFrame> placementFrame() const;
168 [[nodiscard]] editing::Revision sourceRevision() const noexcept;
169
170private:
171 struct Impl;
172 explicit ScenePhysicsPlacementBackend(std::unique_ptr<Impl> impl);
173 std::unique_ptr<Impl> impl_;
174};
175
176} // namespace eve::scene_editor
float y
Definition AnimClip.cpp:738
float x
Definition AnimClip.cpp:738
float z
Definition AnimClip.cpp:738
void * impl
#define EVENGINE_API_EDITORS
Definition Export.h:112
const GltfImportRequest & request
size_t offset
SimulationTick tick
float step
Definition TreeMesh.cpp:314
Move-only operation result carrying either a value or Status.
Definition Result.h:155
UUID-backed identifier adapter for legacy textual boundaries.
Definition Identity.h:314
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.
Captured placement state suitable for drawing and final transaction planning.
std::vector< PhysicsPlacementObject > objects
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.