载入中...
搜索中...
未找到
JoltInternal.h
浏览该文件的文档.
21eve::Result<T> rejected(const char* operation, eve::DiagnosticCode code = eve::DiagnosticCode::Unsupported) {
22 return eve::Result<T>::failure(eve::Diagnostic::error(code, std::string("Jolt: ") + operation, "physics.jolt"));
25inline bool isFinite(float x, float y, float z) { return std::isfinite(x) && std::isfinite(y) && std::isfinite(z); }
26struct Layers final : JPH::BroadPhaseLayerInterface, JPH::ObjectVsBroadPhaseLayerFilter, JPH::ObjectLayerPairFilter {
61 JPH::JobSystemSingleThreaded jobs{JPH::cMaxPhysicsJobs};
117 void OnContactSolved(const JPH::Body&, const JPH::SubShapeID&, const JPH::Body&, const JPH::SubShapeID&,
127[[nodiscard]] eve::Result<JPH::RefConst<JPH::Shape>> cook(const ShapeGeometry3D&, float density, JPH::uint64 userData);
128[[nodiscard]] eve::Result<JPH::RefConst<JPH::Shape>> cookMesh(const ShapeGeometry3D&, JPH::uint64 userData);
132[[nodiscard]] eve::Result<void> replaceShapes(BodyState&, const std::vector<std::shared_ptr<ShapeState>>&);
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
Backend-neutral 3D rigid body in meter-space coordinates (+Y up by convention). Owned by a World3D; c...
Definition Body3D.h:31
3D shape (box/sphere/capsule) attached to a Body3D with material settings. Created via Body3D::new*Sh...
Definition Shape3D.h:34
Definition JoltBody.cpp:7
int triangleIndex(const JPH::Body &, const JPH::SubShapeID &)
Definition JoltMesh.cpp:89
eve::Result< T > rejected(const char *operation, eve::DiagnosticCode code=eve::DiagnosticCode::Unsupported)
Definition JoltInternal.h:21
void initializeRuntime()
Initializes the process-owned allocator and type factory before constructing any native members.
Definition JoltState.cpp:84
eve::Result< void > replaceShapes(BodyState &, const std::vector< std::shared_ptr< ShapeState > > &)
Definition JoltShape.cpp:77
eve::Result< JPH::RefConst< JPH::Shape > > cookMesh(const ShapeGeometry3D &, JPH::uint64 userData)
Definition JoltMesh.cpp:10
SurfaceMaterial3D contactMaterial(const JPH::Body &, const JPH::SubShapeID &, const ShapeState &)
Definition JoltMesh.cpp:96
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
eve::Result< JPH::RefConst< JPH::Shape > > cook(const ShapeGeometry3D &, float density, JPH::uint64 userData)
Definition JoltShape.cpp:16
eve::Result< void > validateMaterial(SurfaceMaterial3D)
Definition JoltShapeOperations.cpp:83
@ Unsupported
Owning contact point, oriented from the queried body toward its neighbour.
Definition OwnedQuery3D.h:23
Collision filter; negative groups never collide, positive groups always collide.
Definition ShapeBackend3D.h:41
Owning, backend-independent shape source; metres, local quaternion XYZW.
Definition ShapeBackend3D.h:13
Owning surface values; userMaterialId contains the engine material ID and combine policy encoding.
Definition ShapeBackend3D.h:34
bool customSleepThreshold
Definition JoltInternal.h:83
std::vector< std::shared_ptr< ShapeState > > shapes
Definition JoltInternal.h:80
Definition JoltJoint.h:11
Definition JoltInternal.h:26
JPH::BroadPhaseLayer GetBroadPhaseLayer(JPH::ObjectLayer layer) const override
Definition JoltInternal.h:28
bool ShouldCollide(JPH::ObjectLayer a, JPH::BroadPhaseLayer b) const override
Definition JoltInternal.h:31
bool ShouldCollide(JPH::ObjectLayer a, JPH::ObjectLayer b) const override
Definition JoltInternal.h:34
JPH::uint GetNumBroadPhaseLayers() const override
Definition JoltInternal.h:27
std::unordered_map< JPH::SubShapeIDPair, ContactPair > contacts
Definition JoltInternal.h:112
std::unordered_map< JPH::SubShapeIDPair, std::vector< SolvedPoint > > solved
Definition JoltInternal.h:113
std::unordered_map< uint64_t, SolvedHit > hits
Definition JoltInternal.h:114
void OnContactSolved(const JPH::Body &, const JPH::SubShapeID &, const JPH::Body &, const JPH::SubShapeID &, const JPH::ContactSolveResult &) override
Definition JoltSolvedContacts.cpp:13
JPH::ValidateResult OnContactValidate(const JPH::Body &, const JPH::Body &, JPH::RVec3Arg, const JPH::CollideShapeResult &) override
Definition JoltState.cpp:111
void OnContactAdded(const JPH::Body &, const JPH::Body &, const JPH::ContactManifold &, JPH::ContactSettings &) override
Definition JoltState.cpp:126
void OnContactRemoved(const JPH::SubShapeIDPair &) override
Definition JoltState.cpp:152
std::unordered_map< uint64_t, float > normalTotals
Definition JoltInternal.h:115
void OnStep(const JPH::PhysicsStepListenerContext &) override
Definition JoltState.cpp:97
void OnContactPersisted(const JPH::Body &, const JPH::Body &, const JPH::ContactManifold &, JPH::ContactSettings &) override
Definition JoltState.cpp:140
JPH::RefConst< JPH::Shape > native
Definition JoltInternal.h:96
std::vector< SurfaceMaterial3D > meshMaterials
Definition JoltInternal.h:99
Definition JoltInternal.h:58
std::unordered_map< JPH::uint64, int > suppressedPairs
Definition JoltInternal.h:66
std::unordered_map< JPH::uint32, std::shared_ptr< BodyState > > bodies
Definition JoltInternal.h:64
std::vector< std::weak_ptr< JointState > > joints
Definition JoltInternal.h:65