Api Sandbox Physics PhysicsJoint
class

PhysicsJoint

public class PhysicsJoint

A physics constraint.

Properties

Name Type Description
World PhysicsWorld The PhysicsWorld this joint belongs to.
Body1 PhysicsBody The source physics body this joint is attached to.
Body2 PhysicsBody The target physics body this joint is constraining.
Point1 PhysicsPoint A specific point this joint is attached at on Body1
Point2 PhysicsPoint A specific point this joint is attached at on Body2
IsActive Boolean
Collisions Boolean Enables or disables collisions between the 2 constrained physics bodies.
Strength Single Strength of the linear constraint. If it takes any more energy than this, it'll break.
AngularStrength Single Strength of the angular constraint. If it takes any more energy than this, it'll break.

Methods

Void Remove()

Removes this joint.

static FixedJoint CreateFixed(PhysicsPoint a, PhysicsPoint b)

Creates an almost solid constraint between two physics bodies.

static SpringJoint CreateLength(PhysicsPoint a, PhysicsPoint b, Single maxLength)

Creates a constraint like a rope, where it has no minimum length but its max length is restrained.

static SpringJoint CreateSpring(PhysicsPoint a, PhysicsPoint b, Single minLength, Single maxLength)

Creates a constraint that will try to stay the same length, like a spring, or a rod.

static HingeJoint CreateHinge(PhysicsPoint a, PhysicsPoint b)
static HingeJoint CreateHinge(PhysicsBody body1, PhysicsBody body2, Transform localFrame1, Transform localFrame2)
static SliderJoint CreateSlider(PhysicsPoint a, PhysicsPoint b, Single minLength, Single maxLength)

Creates a slider constraint between two physics bodies via PhysicsPoints.

static BallSocketJoint CreateBallSocket(PhysicsBody body1, PhysicsBody body2, Vector3 origin)

Creates a ball socket constraint.

body1 — The source physics body.
body2 — The target physics body to constrain to.
origin — The origin of the hinge in world coordinates. The 2 bodies will rotate around this point.
returns — The created ball socket joint.
static BallSocketJoint CreateBallSocket(PhysicsPoint a, PhysicsPoint b)

Creates a ball socket constraint.

a — The source physics body.
b — The target physics body to constrain to.
returns — The created ball socket joint.
static ControlJoint CreateControl(PhysicsPoint a, PhysicsPoint b)
static HingeJoint CreateHinge(PhysicsBody body1, PhysicsBody body2, Vector3 center, Vector3 axis)
static SliderJoint CreateSlider(PhysicsBody body1, PhysicsBody body2, Vector3 origin1, Vector3 origin2, Vector3 axis, Single minLength, Single maxLength)
static PulleyJoint CreatePulley(PhysicsBody body1, PhysicsBody body2, Vector3 anchor1, Vector3 ground1, Vector3 anchor2, Vector3 ground2)
Assembly: Sandbox.Engine Namespace: Sandbox.Physics Full Name: Sandbox.Physics.PhysicsJoint