载入中...
搜索中...
未找到
WorldJoints2D.cpp
浏览该文件的文档.
141Mechanism2D *World::newRatchet(Body *frame, Body *wheel, float anchorX, float anchorY, int direction,
constexpr bool isValid() const noexcept
Returns whether both coordinates are usable handle values.
Definition RuntimeHandle.h:146
static constexpr index_type invalidIndex
Reserved index value shared by all invalid handles.
Definition RuntimeHandle.h:124
2D rigid body (Box2D) in pixel-space coordinates. Owned by a World; create shapes with newRectangleFi...
Definition Body.h:21
Owning planar joint wrapper observing World-owned backend state. @ownership Caller/VM owns factory wr...
Definition Joint2D.h:58
static Result< std::unique_ptr< Joint2D > > create(World &world, Body &a, Body &b, const Joint2DSettings &settings)
Create a constraint; rejects invalid input, foreign/dead bodies, Gear kind and locked worlds atomical...
Definition Joint2D.cpp:61
PhysicsJointHandle runtimeHandle() const noexcept
Process-local generation handle; invalid after destruction, never serialized.
Definition Joint2D.h:182
static Result< std::unique_ptr< Joint2D > > createGear(World &world, Joint2D &first, Joint2D &second, float ratio)
Couple two revolute/prismatic joints in the same world with coordinate1 + ratio*coordinate2 constant.
Definition Joint2D.cpp:153
Composed 2D mechanical assembly owned by a World.
Definition Mechanism2D.h:25
@ CrankSlider
Box2D world wrapper (2D physics) with pixel-space coordinates. Handles stepping, gravity,...
Definition World.h:44
void forgetMechanism(Mechanism2D *mechanism)
Internal: removes a mechanism wrapper from ownership bookkeeping.
Definition WorldJoints2D.cpp:48
Joint2D * newDistanceJoint(Body *bodyA, Body *bodyB, float anchorAX, float anchorAY, float anchorBX, float anchorBY, float lengthPixels, bool collideConnected=false)
Connects two pixel-space anchors with a distance constraint.
Definition WorldJoints2D.cpp:78
Joint2D * newWheelJoint(Body *bodyA, Body *bodyB, float anchorX, float anchorY, float axisX, float axisY, bool collideConnected=false)
Creates a wheel joint with a pixel-space suspension axis.
Definition WorldJoints2D.cpp:109
Joint2D * newWeldJoint(Body *bodyA, Body *bodyB, float anchorX, float anchorY, bool collideConnected=false)
Welds two bodies at a shared pixel-space anchor.
Definition WorldJoints2D.cpp:102
Joint2D * findJoint(PhysicsJointHandle handle) const
Resolves a live joint handle; returns null when stale or foreign.
Definition WorldJoints2D.cpp:63
void forgetJoint(Joint2D *joint)
Internal: removes a joint wrapper from ownership bookkeeping.
Definition WorldJoints2D.cpp:36
Joint2D * newPrismaticJoint(Body *bodyA, Body *bodyB, float anchorX, float anchorY, float axisX, float axisY, bool collideConnected=false)
Creates a prismatic slider along a pixel-space axis.
Definition WorldJoints2D.cpp:94
Joint2D * newRevoluteJoint(Body *bodyA, Body *bodyB, float anchorX, float anchorY, bool collideConnected=false)
Creates a revolute hinge at a shared pixel-space anchor.
Definition WorldJoints2D.cpp:87
Mechanism2D * newCrankSlider(Body *frame, Body *crank, Body *rod, Body *slider, float crankAnchorX, float crankAnchorY, float crankPinX, float crankPinY, float sliderPinX, float sliderPinY, float slideAxisX, float slideAxisY, bool collideConnected=false)
Builds a planar crank-slider from frame, crank, connecting rod and slider bodies.
Definition WorldJoints2D.cpp:156
Joint2D * newGearJoint(Joint2D *joint1, Joint2D *joint2, float ratio)
Creates a gear joint that couples two revolute or prismatic joints.
Definition WorldJoints2D.cpp:123
Mechanism2D * newRatchet(Body *frame, Body *wheel, float anchorX, float anchorY, int direction, float engagementTorque, bool collideConnected=false)
Builds a one-way ratchet around a revolute hinge.
Definition WorldJoints2D.cpp:141
PhysicsJointHandle nextJointRuntimeHandle()
Internal: next generation-qualified joint handle.
Definition WorldJoints2D.cpp:57
Joint2D * newMotorJoint(Body *bodyA, Body *bodyB, bool collideConnected=false)
Creates a motor joint that drives relative pose between bodies.
Definition WorldJoints2D.cpp:117
Mechanism2D * newShaft(Body *support, Body *rotor, float anchorX, float anchorY, bool collideConnected=false)
Builds a shaft (support↔rotor revolute) with optional drive motor helpers.
Definition WorldJoints2D.cpp:130
@ Distance
@ Revolute
@ Prismatic
eve::RuntimeHandle< PhysicsJointHandleTag > PhysicsJointHandle
Generation-qualified runtime identity for a physics joint.
Definition PhysicsHandles.h:32
Validated-at-creation joint parameters; all lengths are meters, angles radians.
Definition Joint2D.h:30