载入中...
搜索中...
未找到
JoltWorldJoints.cpp
浏览该文件的文档.
11JointResult createJoint(WorldBackend& world, Body3D& a, Body3D& b, JointKind3D kind, JPH::RVec3Arg anchorA,
14 return rejected<std::unique_ptr<IJointBackend3D>>("World expired", eve::DiagnosticCode::StaleHandle);
15 if (&a == &b || !a.isValid() || !b.isValid() || a.getWorld() != world.owner || b.getWorld() != world.owner ||
18 !std::isfinite(axis.LengthSq()) || axis.LengthSq() < 1.e-12f || !std::isfinite(length) || length < 0 ||
51 kind == JointKind3D::Prismatic || kind == JointKind3D::Wheel ? JPH::Vec3::sAxisX() : JPH::Vec3::sAxisZ(),
54 portableFrame(nb, anchorB, kind == JointKind3D::Prismatic ? JPH::Vec3::sAxisX() : JPH::Vec3::sAxisZ(),
107 if (kind == JointKind3D::Revolute || kind == JointKind3D::Prismatic || kind == JointKind3D::Motor) {
130eve::Result<std::unique_ptr<IJointBackend3D>> WorldBackend::newDistanceJoint(Body3D& a, Body3D& b, float ax, float ay,
133 return createJoint(*this, a, b, JointKind3D::Distance, {ax, ay, az}, {bx, by, bz}, JPH::Vec3::sAxisX(),
136eve::Result<std::unique_ptr<IJointBackend3D>> WorldBackend::newWheelJoint(Body3D& a, Body3D& b, float x, float y,
141eve::Result<std::unique_ptr<IJointBackend3D>> WorldBackend::newWeldJoint(Body3D& a, Body3D& b, float x, float y,
146eve::Result<std::unique_ptr<IJointBackend3D>> WorldBackend::newMotorJoint(Body3D& a, Body3D& b, bool collide) {
150eve::Result<std::unique_ptr<IJointBackend3D>> WorldBackend::newFilterJoint(Body3D& a, Body3D& b) {
151 return createJoint(*this, a, b, JointKind3D::Filter, {0, 0, 0}, {0, 0, 0}, JPH::Vec3::sAxisX(), JPH::Vec3::sAxisZ(),
154eve::Result<std::unique_ptr<IJointBackend3D>> WorldBackend::newParallelJoint(Body3D& a, Body3D& b, float x, float y,
159eve::Result<std::unique_ptr<IJointBackend3D>> WorldBackend::newRevoluteJoint(Body3D& a, Body3D& b, float x, float y,
165eve::Result<std::unique_ptr<IJointBackend3D>> WorldBackend::newPrismaticJoint(Body3D& a, Body3D& b, float x, float y,
171eve::Result<std::unique_ptr<IJointBackend3D>> WorldBackend::newSphericalJoint(Body3D& a, Body3D& b, float x, float y,
Backend-neutral 3D rigid body in meter-space coordinates (+Y up by convention). Owned by a World3D; c...
Definition Body3D.h:31
eve::Result< std::unique_ptr< IJointBackend3D > > newDistanceJoint(Body3D &bodyA, Body3D &bodyB, float anchorAX, float anchorAY, float anchorAZ, float anchorBX, float anchorBY, float anchorBZ, float length, bool collideConnected) override
Creates an owning Distance constraint; bodies are synchronous non-owning inputs. @cost One native con...
Definition JoltWorldJoints.cpp:130
eve::Result< std::unique_ptr< IJointBackend3D > > newWeldJoint(Body3D &bodyA, Body3D &bodyB, float anchorX, float anchorY, float anchorZ, bool collideConnected) override
Creates an owning Weld constraint; bodies are synchronous non-owning inputs. @cost One native constra...
Definition JoltWorldJoints.cpp:141
eve::Result< std::unique_ptr< IJointBackend3D > > newSphericalJoint(Body3D &bodyA, Body3D &bodyB, float anchorX, float anchorY, float anchorZ, float axisX, float axisY, float axisZ, bool collideConnected) override
Creates an owning Spherical constraint; bodies are synchronous non-owning inputs. @cost One native co...
Definition JoltWorldJoints.cpp:171
eve::Result< std::unique_ptr< IJointBackend3D > > newParallelJoint(Body3D &bodyA, Body3D &bodyB, float axisX, float axisY, float axisZ, bool collideConnected) override
Creates an owning Parallel constraint; bodies are synchronous non-owning inputs. @cost One native con...
Definition JoltWorldJoints.cpp:154
eve::Result< std::unique_ptr< IJointBackend3D > > newPrismaticJoint(Body3D &bodyA, Body3D &bodyB, float anchorX, float anchorY, float anchorZ, float axisX, float axisY, float axisZ, bool collideConnected) override
Creates an owning Prismatic constraint; bodies are synchronous non-owning inputs. @cost One native co...
Definition JoltWorldJoints.cpp:165
eve::Result< std::unique_ptr< IJointBackend3D > > newFilterJoint(Body3D &bodyA, Body3D &bodyB) override
Creates an owning Filter constraint; bodies are synchronous non-owning inputs. @cost One native const...
Definition JoltWorldJoints.cpp:150
eve::Result< std::unique_ptr< IJointBackend3D > > newWheelJoint(Body3D &bodyA, Body3D &bodyB, float anchorX, float anchorY, float anchorZ, float suspensionAxisX, float suspensionAxisY, float suspensionAxisZ, float wheelAxisX, float wheelAxisY, float wheelAxisZ, bool collideConnected) override
Creates an owning Wheel constraint; bodies are synchronous non-owning inputs. @cost One native constr...
Definition JoltWorldJoints.cpp:136
eve::Result< std::unique_ptr< IJointBackend3D > > newMotorJoint(Body3D &bodyA, Body3D &bodyB, bool collideConnected) override
Creates an owning Motor constraint; bodies are synchronous non-owning inputs. @cost One native constr...
Definition JoltWorldJoints.cpp:146
eve::Result< std::unique_ptr< IJointBackend3D > > newRevoluteJoint(Body3D &bodyA, Body3D &bodyB, float anchorX, float anchorY, float anchorZ, float axisX, float axisY, float axisZ, bool collideConnected) override
Creates an owning Revolute constraint; bodies are synchronous non-owning inputs. @cost One native con...
Definition JoltWorldJoints.cpp:159
Definition JoltBody.cpp:7
eve::Result< T > rejected(const char *operation, eve::DiagnosticCode code=eve::DiagnosticCode::Unsupported)
Definition JoltInternal.h:21
JPH::Ref< JPH::TwoBodyConstraint > createDistanceConstraint(JPH::Body &a, JPH::Body &b, const JPH::DistanceConstraintSettings &settings)
Native Jolt solver composition for independently configurable distance spring, limits and motor....
Definition JoltDistanceConstraint.cpp:137
JointKind3D
Stable constraint kinds; numeric values are used by stress events.
Definition JointBackend3D.h:13
@ Distance
@ Spherical
@ Revolute
@ Prismatic
@ Parallel
@ InvalidArgument
@ StaleHandle