载入中...
搜索中...
未找到
World3D.h
浏览该文件的文档.
125 eve::Result<void> step(const eve::SimulationStep &step, const SimulationSettings &settings = {});
145 [[nodiscard]] std::weak_ptr<const void> lifetimeToken() const noexcept { return queryLifetime_; }
165 eve::Result<eve::SnapshotEnvelope> snapshot(const eve::SnapshotHashProvider &hashProvider) const;
184 eve::Result<void> restore(const eve::SnapshotEnvelope &snapshot, const eve::SnapshotHashProvider &hashProvider);
628 double x, double y, double z, double endX, double endY, double endZ, eve::WorldSphereSweepSettings settings);
640 [[nodiscard]] eve::Result<void> applySweepContactImpulse(const eve::WorldSphereContact &contact,
886 [[nodiscard]] eve::Result<BodyContacts3D> queryBodyContactsOwned(PhysicsBodyHandle body, int maxPoints) const;
1010 [[nodiscard]] ClothProbeStatus pointProbeFiltered(float x, float y, float z, float radius, ClothContact3D *out,
1053 friend class action_adapter::ActionCollisionIgnoreState;
1057 [[nodiscard]] Result<void> restorePortable(const SnapshotEnvelope &, const SnapshotHashProvider &);
1067 World3D(float gravityX, float gravityY, float gravityZ, bool sleep, eve::PersistentId instanceId,
1079 [[nodiscard]] Result<void> stepCoupledBackend(const SimulationStep &step, const SimulationSettings &settings);
Vocabulary aliases for nullable and checked borrowed references.
Owning, generation-qualified results for cross-module 3D physics queries.
Process-local, generation-qualified handles owned by the physics domain.
Move-only, checked operation results for the common layer.
Backend-neutral, observable fixed-step contract for physics domains.
Versioned, integrity-checked persistence envelopes.
Backend-neutral 3D rigid body in meter-space coordinates (+Y up by convention). Owned by a World3D; c...
Definition Body3D.h:31
Owning 3D transmission constraint, stepped transactionally by its World3D. @ownership Caller/VM owns ...
Definition Coupling3D.h:50
Move-only, single-use collection of validated force requests. @ownership Owns values and handles only...
Definition ForceBatch.h:26
Minimal observable contract for physics simulation providers.
Definition SimulationBackend.h:158
Complete rigid-world execution boundary, bound once to an owning World3D facade. @ownership Owns exac...
Definition WorldBackend3D.h:24
Script-facing joint owned by a World3D. Legacy scalar/void methods adapt the checked backend contract...
Definition Joint3D.h:27
Composed mechanical assembly owned by a World3D.
Definition Mechanism3D.h:25
3D shape (box/sphere/capsule) attached to a Body3D with material settings. Created via Body3D::new*Sh...
Definition Shape3D.h:34
Read-only 3D physics implementation of sensing's LOS capability.
Definition TargetingLineOfSightAdapter.h:30
Box3D rigid-body world. Script coordinates are meters (Box3D native), unlike 2D World which uses pixe...
Definition World3D.h:47
bool hasClosestPoint() const
Whether the latest closestPoint call found a shape.
Definition World3D.h:687
int getBeginTriggerVisitorShapeId(int index) const
Visitor shape ID of a begin-trigger event.
int getBeginContactShapeAId(int index) const
Shape ID on stable side A of a begin-contact event.
float getShapeCastX() const
World-space contact point X from the last shape cast.
Definition World3D.h:722
int getEndTriggerCount() const
Number of sensor overlaps that ended during the latest step.
Definition World3D.h:860
float getJointStressForceY(int index) const
Constraint force Y of a stress event.
int getClosestShapeId() const
Stable shape id from the latest closestPoint call, or -1.
Definition World3D.h:691
float getContactPointTotalNormalImpulse(int index) const
Total normal impulse accumulated across all physics substeps.
int getRayHitTriangleIndex() const
Mesh/height-field triangle index from the last ray cast, otherwise -1.
Definition World3D.h:530
float getHitNormalX(int index) const
Hit normal X, pointing from stable side A to B.
eve::PersistentId persistentId() const noexcept
Stable non-nil identity written to snapshot envelopes.
Definition World3D.h:147
int getShapeCastResultShapeId(int index) const
Shape ID of a sorted Shape Cast result.
int getBeginTriggerSensorBodyId(int index) const
Sensor body ID of a begin-trigger event.
float getContactPushOutSpeed() const
Current maximum contact push-out speed in m/s.
Definition World3D.h:223
float getContactPointNormalImpulse(int index) const
Normal impulse from the final physics substep.
int getEndContactShapeBId(int index) const
Shape ID on stable side B of an end-contact event.
float getShapeCastResultFraction(int index) const
Translation fraction in [0,1] of a Shape Cast result.
int getClosestShapeTag() const
User tag of the shape from the latest closestPoint call, or zero.
Definition World3D.h:693
PhysicsWorldHandle runtimeHandle() const noexcept
Process-local identity used by PhysicsLink; invalid after destruction.
Definition World3D.h:136
int getEndContactBodyAId(int index) const
Body ID on stable side A of an end-contact event.
int getEndContactShapeATag(int index) const
Shape Tag on stable side A of an end-contact event.
int getShapeCastShapeId() const
Stable shape id from the last shape cast, or -1.
Definition World3D.h:714
int getRayResultTriangleIndex(int index) const
Mesh/height-field triangle index of a sorted ray result, otherwise -1.
float getShapeCastZ() const
World-space contact point Z from the last shape cast.
Definition World3D.h:726
float getContactPointX(int index) const
World-space contact point X on the queried body.
std::weak_ptr< const void > lifetimeToken() const noexcept
Return a weak lifetime token for owner-thread runtime integrations.
Definition World3D.h:145
int getBeginContactBodyBId(int index) const
Body ID on stable side B of a begin-contact event.
int getContactPointOtherShapeId(int index) const
Other Shape ID of a contact point.
float getMoverNormalY() const
Representative blocking normal Y from the last move.
Definition World3D.h:789
int getQueryShapeCount() const
Number of individual shapes hit by the last overlap query.
Definition World3D.h:810
float getExplosionResultDeltaVelocityX(int index) const
Explosion-induced linear velocity delta X.
World3D(const World3D &)=delete
World3D & operator=(const World3D &)=delete
float getRayResultNormalY(int index) const
Surface normal Y of a sorted ray result.
float getContactPointSeparation(int index) const
Signed surface separation; negative values indicate penetration.
int getHitShapeBId(int index) const
Stable Shape ID on side B of a hit.
float getClosestNormalX() const
Surface-to-target normal X, or zero for an inside/on-surface target.
Definition World3D.h:701
float getMoverDeltaZ() const
Resolved translation Z from the last moveCapsule call.
Definition World3D.h:785
int getHitCount() const
Number of significant collision hits generated during the latest step.
Definition World3D.h:931
int getJointStressKind(int index) const
Joint kind code: 0 distance, 1 revolute, 2 prismatic, 3 spherical, 4 wheel.
int getShapeCastShapeTag() const
User tag of the shape from the last shape cast, or zero on no hit.
Definition World3D.h:716
float getMoverDeltaY() const
Resolved translation Y from the last moveCapsule call.
Definition World3D.h:783
int getBeginTriggerCount() const
Number of sensor overlaps that began during the latest step.
Definition World3D.h:846
int getExplosionResultBodyId(int index) const
Stable Body ID of an affected body, sorted ascending.
float getMoverNormalZ() const
Representative blocking normal Z from the last move.
Definition World3D.h:791
int getBeginTriggerVisitorShapeTag(int index) const
Visitor Shape Tag of a begin-trigger event.
int getEndContactShapeBTag(int index) const
Shape Tag on stable side B of an end-contact event.
float getClosestDistance() const
Non-negative distance from the target to the closest shape.
Definition World3D.h:707
int getHitBodyBId(int index) const
Stable body ID on side B of a hit.
int getContactPointShapeTag(int index) const
Queried-body Shape Tag of a contact point.
float getHitNormalImpulse(int index) const
Total normal impulse accumulated across all manifolds and substeps.
int getHitShapeAId(int index) const
Stable Shape ID on side A of a hit.
float getContactPointY(int index) const
World-space contact point Y on the queried body.
float getContactPointNormalY(int index) const
Contact normal Y from queried body toward the other body.
int getBeginContactCount() const
Number of non-sensor contacts that began during the latest step.
Definition World3D.h:817
int getJointStressBodyAId(int index) const
Stable body A ID of a stress event.
float getShapeCastResultNormalZ(int index) const
Contact normal Z of a Shape Cast result.
int getEndContactCount() const
Number of non-sensor contacts that ended during the latest step.
Definition World3D.h:831
int getRayResultShapeId(int index) const
Shape ID of a sorted ray result.
int getBeginTriggerSensorShapeId(int index) const
Sensor shape ID of a begin-trigger event.
int getJointStressCount() const
Number of joints exceeding force/torque thresholds in the latest step.
Definition World3D.h:961
float getShapeCastResultY(int index) const
World-space contact point Y of a Shape Cast result.
int getShapeCastTriangleIndex() const
Mesh/height-field triangle index from the latest shape cast, otherwise -1.
Definition World3D.h:720
float getMoverDeltaX() const
Resolved translation X from the last moveCapsule call.
Definition World3D.h:781
int getShapeCastMaterialId() const
Surface material ID at the last shape-cast intersection, or zero.
Definition World3D.h:718
float getRayResultFraction(int index) const
Segment fraction in [0,1] of a sorted ray result.
int getEndTriggerSensorShapeTag(int index) const
Sensor Shape Tag of an end-trigger event.
int getBeginContactShapeATag(int index) const
Shape Tag on stable side A of a begin-contact event.
int getContactPointOtherBodyId(int index) const
Other Body ID of a contact point.
int getEndTriggerSensorShapeId(int index) const
Sensor shape ID of an end-trigger event.
float getShapeCastResultNormalX(int index) const
Contact normal X of a Shape Cast result.
int getClosestBodyId() const
Stable body id from the latest closestPoint call, or -1.
Definition World3D.h:689
float getContactPointZ(int index) const
World-space contact point Z on the queried body.
int getBeginContactShapeBTag(int index) const
Shape Tag on stable side B of a begin-contact event.
float getExplosionResultDeltaAngularVelocityY(int index) const
Explosion-induced angular velocity delta Y.
float getExplosionResultDeltaVelocityY(int index) const
Explosion-induced linear velocity delta Y.
float getRayResultX(int index) const
World-space hit point X of a sorted ray result.
int getEndTriggerVisitorShapeId(int index) const
Visitor shape ID of an end-trigger event.
int getQueryIgnoredShapeId() const
Stable Shape3D ID currently ignored by queries, or -1.
Definition World3D.h:997
int getEndTriggerVisitorShapeTag(int index) const
Visitor Shape Tag of an end-trigger event.
int getShapeCastBodyId() const
Stable body id from the last shape cast, or -1.
Definition World3D.h:712
float getShapeCastY() const
World-space contact point Y from the last shape cast.
Definition World3D.h:724
int getContactPointShapeId(int index) const
Queried-body Shape ID of a contact point.
float getExplosionResultDeltaAngularVelocityX(int index) const
Explosion-induced angular velocity delta X.
float getShapeCastResultX(int index) const
World-space contact point X of a Shape Cast result.
int getRayHitMaterialId() const
Surface material ID at the last ray intersection, or zero.
Definition World3D.h:528
RigidBackend3D rigidBackendKind() const noexcept
Returns the immutable rigid solver identity; constant-time, simulation thread.
Definition World3D.h:104
float getJointStressForceZ(int index) const
Constraint force Z of a stress event.
int getShapeCastResultTriangleIndex(int index) const
Mesh/height-field triangle index of a Shape Cast result, otherwise -1.
float getClosestNormalZ() const
Surface-to-target normal Z, or zero for an inside/on-surface target.
Definition World3D.h:705
std::uint64_t queryEpoch() const noexcept
Monotonic query binding revision; successful restore invalidates prior sessions.
Definition World3D.h:645
int getExplosionResultCount() const
Number of bodies affected by the latest explosion.
Definition World3D.h:250
float getShapeCastResultZ(int index) const
World-space contact point Z of a Shape Cast result.
int getRayHitShapeTag() const
User tag of the shape from the last ray cast, or zero on no hit.
Definition World3D.h:526
int getHitShapeBTag(int index) const
Shape Tag on side B of a hit.
float getClosestNormalY() const
Surface-to-target normal Y, or zero for an inside/on-surface target.
Definition World3D.h:703
int getHitBodyAId(int index) const
Stable body ID on side A of a hit.
float getJointStressForceX(int index) const
Constraint force X of a stress event.
float getContactPointNormalVelocity(int index) const
Pre-solve relative normal velocity; negative means approaching.
int getRayResultShapeTag(int index) const
Shape Tag of a sorted ray result.
int getShapeCastResultShapeTag(int index) const
Shape Tag of a sorted Shape Cast result.
float getShapeCastFraction() const
Translation fraction in [0,1] at the earliest hit.
Definition World3D.h:734
int getBeginContactShapeBId(int index) const
Shape ID on stable side B of a begin-contact event.
int getEndTriggerSensorBodyId(int index) const
Sensor body ID of an end-trigger event.
int getEndTriggerVisitorBodyId(int index) const
Visitor body ID of an end-trigger event.
int getQueryIgnoredBodyId() const
Stable Body3D ID currently ignored by queries, or -1.
Definition World3D.h:995
int getContactPointCount() const
Number of points cached by queryBodyContacts.
Definition World3D.h:896
float getExplosionResultDeltaAngularVelocityZ(int index) const
Explosion-induced angular velocity delta Z.
float getRayResultNormalX(int index) const
Surface normal X of a sorted ray result.
float getShapeCastResultNormalY(int index) const
Contact normal Y of a Shape Cast result.
int getJointStressBodyBId(int index) const
Stable body B ID of a stress event.
int getEndContactShapeAId(int index) const
Shape ID on stable side A of an end-contact event.
float getContactPointNormalX(int index) const
Contact normal X from queried body toward the other body.
float getHitNormalY(int index) const
Hit normal Y, pointing from stable side A to B.
float getHitApproachSpeed(int index) const
Positive pre-solve approach speed in m/s.
bool hasShapeCastHit() const
Whether the last sphere, capsule, or box cast hit a body.
Definition World3D.h:710
float getMoverNormalX() const
Representative blocking normal X from the last move.
Definition World3D.h:787
int getShapeCastResultMaterialId(int index) const
Surface material ID at a sorted Shape Cast intersection.
int getEndContactBodyBId(int index) const
Body ID on stable side B of an end-contact event.
int getRayResultCount() const
Number of results cached by the latest rayCast or rayCastAll call.
Definition World3D.h:539
float getExplosionResultDeltaVelocityZ(int index) const
Explosion-induced linear velocity delta Z.
bool usedBackendFallback() const noexcept
Whether optional accelerator selection fell back to CPU.
Definition World3D.h:153
float getHitNormalZ(int index) const
Hit normal Z, pointing from stable side A to B.
int getBeginTriggerSensorShapeTag(int index) const
Sensor Shape Tag of a begin-trigger event.
float getRayResultNormalZ(int index) const
Surface normal Z of a sorted ray result.
int getShapeCastResultBodyId(int index) const
Body ID of a sorted Shape Cast result.
int getHitShapeATag(int index) const
Shape Tag on side A of a hit.
float getJointStressTorqueY(int index) const
Constraint torque Y of a stress event.
int getJointStressJointId(int index) const
Stable Joint3D ID of a stress event.
int getBeginContactBodyAId(int index) const
Body ID on stable side A of a begin-contact event.
int getBeginTriggerVisitorBodyId(int index) const
Visitor body ID of a begin-trigger event.
float getJointStressTorqueZ(int index) const
Constraint torque Z of a stress event.
int getMoverIterations() const
Number of outer solver passes used by the last move.
Definition World3D.h:795
float getRayResultY(int index) const
World-space hit point Y of a sorted ray result.
int getShapeCastResultCount() const
Number of results cached by the latest single or multi Shape Cast.
Definition World3D.h:736
int getMoverPlaneCount() const
Number of collision planes considered during the last move.
Definition World3D.h:793
float getJointStressTorqueX(int index) const
Constraint torque X of a stress event.
int getContactPointOtherShapeTag(int index) const
Other Shape Tag of a contact point.
int getRayResultBodyId(int index) const
Body ID of a sorted ray result.
int getRayResultMaterialId(int index) const
Surface material ID at a sorted ray intersection.
float getContactPointNormalZ(int index) const
Contact normal Z from queried body toward the other body.
float getMoverGroundDot() const
Largest dot product between mover up and a contact normal.
Definition World3D.h:803
bool isMoverGrounded() const
True when the last move touched a walkable plane.
Definition World3D.h:801
float getRayResultZ(int index) const
World-space hit point Z of a sorted ray result.
SimulationBackendKind
Kind of implementation that owns a simulation step.
Definition SimulationBackend.h:32
RigidBackend3D
Solver identity fixed for the lifetime of one world; independent of CPU/GPU execution.
Definition WorldBackend3D.h:11
SimulationDeterminism
Determinism guarantee made by a simulation backend.
Definition SimulationBackend.h:64
std::function< Result< ContentId >(std::string_view canonicalInput)> SnapshotHashProvider
Injected content-digest implementation used by snapshots.
Definition Snapshot.h:36
Definition Container.h:602
Stable outer format shared by persistence and cross-process snapshots.
Definition Snapshot.h:46
Owning sphere sweep contact; position is the moving sphere center, not the obstacle surface.
Definition WorldSphereSweep.h:18
Immutable per-binding sphere and filter policy.
Definition WorldSphereSweep.h:29
Owning contact point, oriented from the queried body toward its neighbour.
Definition OwnedQuery3D.h:23
Per-call capsule mover classification policy; never mutates persistent World3D settings.
Definition OwnedQuery3D.h:55
Result of a 3D point probe: deepest non-sensor shape within radius. Normal points from the shape towa...
Definition World3DTypes.h:20
Query filter applied atomically for one owning query operation.
Definition OwnedQuery3D.h:47
Observable backend progress shared by CPU and accelerator providers.
Definition SimulationBackend.h:136
Validated solver policy for one simulation step.
Definition SimulationBackend.h:120
Begin/end event for two non-sensor shapes.
Definition World3D.h:57
Stable snapshot describing one side of a 3D collision event.
Definition World3D.h:50
Significant collision containing world-space feedback data.
Definition World3D.h:69
Joint whose solver force or torque exceeded a configured threshold.
Definition World3D.h:78
Begin/end overlap event with an explicit sensor and visitor side.
Definition World3D.h:63
Private bridge used exclusively by Box3D composition and native query code.
Definition Box3DBody.h:15