载入中...
搜索中...
未找到
World3D.h
浏览该文件的文档.
130 eve::Result<void> step(const eve::SimulationStep &step, const SimulationSettings &settings = {});
150 [[nodiscard]] std::weak_ptr<const void> lifetimeToken() const noexcept { return queryLifetime_; }
170 eve::Result<eve::SnapshotEnvelope> snapshot(const eve::SnapshotHashProvider &hashProvider) const;
183 eve::Result<void> restore(const eve::SnapshotEnvelope &snapshot, const eve::SnapshotHashProvider &hashProvider);
966 [[nodiscard]] ClothProbeStatus pointProbeFiltered(float x, float y, float z, float radius, ClothContact3D *out,
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.
static Status success(StatusCode code=StatusCode::Ok)
Construct a successful status with an explicit non-error outcome.
Definition Status.h:81
static constexpr StrongUint64 zero() noexcept
Returns the zero value for this strong type.
Definition StrongUint64.h:24
3D rigid body (Box3D) in meter-space coordinates (+Y up by convention). Owned by a World3D; create pr...
Definition Body3D.h:24
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:25
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:63
bool hasClosestPoint() const
Whether the latest closestPoint call found a shape.
Definition World3D.h:655
int getBeginTriggerVisitorShapeId(int index) const
Visitor shape ID of a begin-trigger event.
float getProfileStepMs() const
Latest complete physics step time in milliseconds.
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:690
int getEndTriggerCount() const
Number of sensor overlaps that ended during the latest step.
Definition World3D.h:828
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:659
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:523
float getHitNormalX(int index) const
Hit normal X, pointing from stable side A to B.
int getDynamicTreeHeight() const
Dynamic broad-phase tree height.
eve::PersistentId persistentId() const noexcept
Stable non-nil identity written to snapshot envelopes.
Definition World3D.h:152
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:222
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:661
PhysicsWorldHandle runtimeHandle() const noexcept
Process-local identity used by PhysicsLink; invalid after destruction.
Definition World3D.h:141
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:682
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:694
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:150
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:757
int getQueryShapeCount() const
Number of individual shapes hit by the last overlap query.
Definition World3D.h:778
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 getProfileBulletsMs() const
Latest continuous-collision bullet time in milliseconds.
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:669
float getMoverDeltaZ() const
Resolved translation Z from the last moveCapsule call.
Definition World3D.h:753
float getProfileCollideMs() const
Latest narrow-phase collision time in milliseconds.
int getHitCount() const
Number of significant collision hits generated during the latest step.
Definition World3D.h:887
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:684
float getMoverDeltaY() const
Resolved translation Y from the last moveCapsule call.
Definition World3D.h:751
int getBeginTriggerCount() const
Number of sensor overlaps that began during the latest step.
Definition World3D.h:814
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:759
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:675
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:785
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:799
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:917
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:688
float getMoverDeltaX() const
Resolved translation X from the last moveCapsule call.
Definition World3D.h:749
int getShapeCastMaterialId() const
Surface material ID at the last shape-cast intersection, or zero.
Definition World3D.h:686
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 getStaticTreeHeight() const
Static broad-phase tree height.
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:657
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 getMemoryByteCount() const
Approximate Box3D world allocation in bytes.
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:953
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:680
float getShapeCastY() const
World-space contact point Y from the last shape cast.
Definition World3D.h:692
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:521
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:673
int getExplosionResultCount() const
Number of bodies affected by the latest explosion.
Definition World3D.h:249
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:519
float getProfileSensorsMs() const
Latest sensor processing time in milliseconds.
int getAwakeContactCount() const
Contacts processed by the latest collide pass.
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:671
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:702
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:951
int getContactPointCount() const
Number of points cached by queryBodyContacts.
Definition World3D.h:852
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.
float getProfileSolveMs() const
Latest constraint solver time in milliseconds.
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 getProfilePairsMs() const
Latest broad-phase pair generation time in milliseconds.
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:678
float getMoverNormalX() const
Representative blocking normal X from the last move.
Definition World3D.h:755
int getRecycledContactCount() const
Contact points recycled during the latest step.
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:532
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:158
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:763
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:704
int getMoverPlaneCount() const
Number of collision planes considered during the last move.
Definition World3D.h:761
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:771
bool isMoverGrounded() const
True when the last move touched a walkable plane.
Definition World3D.h:769
float getRayResultZ(int index) const
World-space hit point Z of a sorted ray result.
Owns temporary body-pair collision overrides projected from Action windows.
Definition ActionCollisionIgnoreState.h:47
SimulationBackendKind
Kind of implementation that owns a simulation step.
Definition SimulationBackend.h:32
SimulationDeterminism
Determinism guarantee made by a simulation backend.
Definition SimulationBackend.h:64
void registerCameraObstructionWorld(World3D *world)
Registers camera obstruction world.
Definition PhysicsCapabilities.cpp:177
std::function< Result< ContentId >(std::string_view canonicalInput)> SnapshotHashProvider
Injected content-digest implementation used by snapshots.
Definition Snapshot.h:36
Stable outer format shared by persistence and cross-process snapshots.
Definition Snapshot.h:46
Per-call capsule mover classification policy; never mutates persistent World3D settings.
Definition OwnedQuery3D.h:30
Result of a 3D point probe: deepest non-sensor shape within radius. Normal points from the shape towa...
Definition World3D.h:45
Query filter applied atomically for one owning query operation.
Definition OwnedQuery3D.h:22
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:73
Stable snapshot describing one side of a 3D collision event.
Definition World3D.h:66
Significant collision containing world-space feedback data.
Definition World3D.h:85
Joint whose solver force or torque exceeded a configured threshold.
Definition World3D.h:94
Begin/end overlap event with an explicit sensor and visitor side.
Definition World3D.h:79