载入中...
搜索中...
未找到
JoltWorldVolumes.cpp
浏览该文件的文档.
14eve::Result<QueryVolume> boxVolume(float x, float y, float z, float w, float h, float d, float qx, float qy, float qz,
17 if (!isFinite(x, y, z) || !isFinite(w, h, d) || w <= 0 || h <= 0 || d <= 0 || !std::isfinite(rotation.LengthSq()) ||
21 volume.shape = new JPH::BoxShape({w * .5f, h * .5f, d * .5f}, std::min({.05f, w * .5f, h * .5f, d * .5f}));
45eve::Result<CapsuleOverlap3D> WorldBackend::queryCapsuleOwned(float ax, float ay, float az, float bx, float by,
53eve::Result<int> WorldBackend::queryCapsule(float ax, float ay, float az, float bx, float by, float bz, float radius) {
63eve::Result<int> WorldBackend::queryBox(float x, float y, float z, float w, float h, float d, float qx, float qy,
67 return overlapQuery(volume.value(), {owner->queryCategoryBits_, owner->queryMaskBits_, owner->queryIgnoredBodyId_,
70eve::Result<int> WorldBackend::castQuery(const QueryVolume& volume, float dx, float dy, float dz, int maxHits) {
74 const QueryFilter3D filter{owner->queryCategoryBits_, owner->queryMaskBits_, owner->queryIgnoredBodyId_,
81 queryHit(*state, hit.mBodyID2, hit.mSubShapeID2, volume.transform.GetTranslation() + hit.mContactPointOn2,
83 values.push_back({r.bodyId, r.shapeId, r.shapeTag, r.materialId, r.triangleIndex, r.x, r.y, r.z, r.normalX,
106eve::Result<int> WorldBackend::castCapsuleAll(float ax, float ay, float az, float bx, float by, float bz, float radius,
112eve::Result<int> WorldBackend::castSphereAll(float x, float y, float z, float radius, float dx, float dy, float dz,
122eve::Result<CameraSphereHit3D> WorldBackend::sphereCast(float x, float y, float z, float x2, float y2, float z2,
125 if (!isValid()) return rejected<CameraSphereHit3D>("World expired", eve::DiagnosticCode::StaleHandle);
129 if (!isFinite(x, y, z)) return rejected<CameraSphereHit3D>("Invalid ray", eve::DiagnosticCode::InvalidArgument);
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
PhysicsWorldHandle runtimeHandle() const noexcept
Process-local identity used by PhysicsLink; invalid after destruction.
Definition World3D.h:136
eve::Result< int > castCapsuleAll(float ax, float ay, float az, float bx, float by, float bz, float radius, float dx, float dy, float dz, int maxHits) override
castCapsuleAll; uses the class ownership, thread and failure contract.
Definition JoltWorldVolumes.cpp:106
eve::Result< CapsuleOverlap3D > queryCapsuleOwned(float ax, float ay, float az, float bx, float by, float bz, float radius, QueryFilter3D filter) override
queryCapsuleOwned; uses the class ownership, thread and failure contract.
Definition JoltWorldVolumes.cpp:45
eve::Result< int > overlapQuery(const QueryVolume &, QueryFilter3D)
Internal synchronous projection of an ephemeral cooked query volume.
Definition JoltWorldVolumes.cpp:26
eve::Result< int > castQuery(const QueryVolume &, float, float, float, int)
Internal synchronous sweep; owning native data is projected into facade caches.
Definition JoltWorldVolumes.cpp:70
eve::Result< int > castBoxAll(float x, float y, float z, float width, float height, float depth, float qx, float qy, float qz, float qw, float dx, float dy, float dz, int maxHits) override
castBoxAll; uses the class ownership, thread and failure contract.
Definition JoltWorldVolumes.cpp:116
eve::Result< int > queryBox(float x, float y, float z, float width, float height, float depth, float qx, float qy, float qz, float qw) override
queryBox; uses the class ownership, thread and failure contract.
Definition JoltWorldVolumes.cpp:63
eve::Result< int > querySphere(float x, float y, float z, float radius) override
querySphere; uses the class ownership, thread and failure contract.
Definition JoltWorldVolumes.cpp:60
eve::Result< int > castSphereAll(float x, float y, float z, float radius, float dx, float dy, float dz, int maxHits) override
castSphereAll; uses the class ownership, thread and failure contract.
Definition JoltWorldVolumes.cpp:112
eve::Result< CameraSphereHit3D > sphereCast(float x1, float y1, float z1, float x2, float y2, float z2, float radius, uint64_t maskBits, int ignoredBodyId) const override
sphereCast; uses the class ownership, thread and failure contract.
Definition JoltWorldVolumes.cpp:122
eve::Result< int > queryCapsule(float ax, float ay, float az, float bx, float by, float bz, float radius) override
queryCapsule; uses the class ownership, thread and failure contract.
Definition JoltWorldVolumes.cpp:53
Definition JoltBody.cpp:7
JPH::AllHitCollisionCollector< JPH::CollideShapeCollector > overlapVolume(const State &state, const QueryVolume &volume, float separation)
Collects owning native records for this synchronous query; no pointers escape.
Definition JoltQueryInternal.cpp:56
bool isAcceptedHit(const State &state, JPH::BodyID id, const JPH::SubShapeID &sub, QueryFilter3D filter)
Filters a synchronous native hit, borrowing state only for the call.
Definition JoltQueryInternal.cpp:23
ShapeState * child(const JPH::Body &body, const JPH::SubShapeID &id)
Resolves a native child record for a synchronous callback or query. @ownership Borrowed from the worl...
Definition JoltInternal.h:138
RayHit3D queryHit(const State &state, JPH::BodyID id, const JPH::SubShapeID &sub, JPH::RVec3Arg point, JPH::Vec3Arg normal, float fraction)
Projects a validated native hit into an owning result on the idle simulation thread.
Definition JoltQueryInternal.cpp:33
eve::Result< QueryVolume > capsuleVolume(float ax, float ay, float az, float bx, float by, float bz, float radius)
Cooks an ephemeral query capsule; inputs are endpoints in world space.
Definition JoltQueryInternal.cpp:9
JPH::AllHitCollisionCollector< JPH::CastShapeCollector > sweepVolume(const State &state, const QueryVolume &volume, JPH::Vec3Arg delta)
Sweeps one ephemeral convex volume; results are local to its starting position.
Definition JoltQueryInternal.cpp:66
@ InvalidArgument
@ StaleHandle
Query filter applied atomically for one owning query operation.
Definition OwnedQuery3D.h:47