DIFF

class PhysicsJointSource

Methods 9

static proto PhysicsHingeJoint CreateHinge(notnull IEntity ent1, IEntity ent2, vector point1, vector axis1, vector point2, vector axis2, bool disableCollisions, float breakThreshold = -1)

Creates hinge joint. Entities must be dynamic objects. Using only ent1 anchors it to the world.

ent1
Entity that will be part of the joint, mandatory
ent2
Other entity that will be part of the joint, optional
point1
Joint position in reference frame of ent1
axis1
Joint axis in reference frame of ent1
point2
Joint position in reference frame of ent2
axis2
Joint axis in reference frame of ent2
disableCollisions
True to disable collisions between connected entities
breakThreshold
Maximum impulse to break the joint. Use -1 for unbreakable joint
IEntity entity1 = GetWorld().FindEntityByName("entity1");
IEntity entity2 = GetWorld().FindEntityByName("entity1");
PhysicsJoint.CreateHinge(entity1, entity2, vector.Right, vector.Up, -vector.Right, vector.Up, false);
static proto PhysicsHingeJoint CreateHinge2(notnull IEntity ent1, IEntity ent2, vector matrix1[4], vector matrix2[4], bool disableCollisions, float breakThreshold = -1)

Creates hinge joint. Entities must be dynamic objects. Using only ent1 anchors it to the world.

ent1
Entity that will be part of the joint, mandatory
ent2
Other entity that will be part of the joint, optional
matrix1
Joint transformation in reference frame of ent1 (hinge is z-axis)
matrix2
Joint transformation in reference frame of ent2 (hinge is z-axis)
disableCollisions
True to disable collisions between connected entities
breakThreshold
Maximum impulse to break the joint. Use -1 for unbreakable joint
IEntity entity1 = GetWorld().FindEntityByName("entity1");
IEntity entity2 = GetWorld().FindEntityByName("entity1");
vector mat1[4] = { vector.Right, -vector.Forward, vector.Up, vector.Right };
vector mat2[4] = { vector.Right, -vector.Forward, vector.Up, -vector.Right };
PhysicsJoint.CreateHinge2(entity1, entity2, mat1, mat2, false);
static proto PhysicsBallSocketJoint CreateBallSocket(notnull IEntity ent1, IEntity ent2, vector point1, vector point2, bool disableCollisions, float breakThreshold = -1)

Creates ball socket joint. Entities must be dynamic objects. Using only ent1 anchors it to the world.

ent1
Entity that will be part of the joint, mandatory
ent2
Other entity that will be part of the joint, optional
point1
Joint position in reference frame of ent1
point2
Joint position in reference frame of ent2
disableCollisions
True to disable collisions between connected entities
breakThreshold
Maximum impulse to break the joint. Use -1 for unbreakable joint
IEntity entity1 = GetWorld().FindEntityByName("entity1");
IEntity entity2 = GetWorld().FindEntityByName("entity1");
PhysicsJoint.CreateBallSocket(entity1, entity2, vector.Right, -vector.Right, false);
static proto PhysicsFixedJoint CreateFixed(notnull IEntity ent1, IEntity ent2, vector point1, vector point2, bool disableCollisions, float breakThreshold = -1)

Creates fixed joint. Entities must be dynamic objects. Using only ent1 anchors it to the world.

ent1
Entity that will be part of the joint, mandatory
ent2
Other entity that will be part of the joint, optional
point1
Joint position in reference frame of ent1
point2
Joint position in reference frame of ent2
disableCollisions
True to disable collisions between connected entities
breakThreshold
Maximum impulse to break the joint. Use -1 for unbreakable joint
IEntity entity1 = GetWorld().FindEntityByName("entity1");
IEntity entity2 = GetWorld().FindEntityByName("entity1");
PhysicsJoint.CreateFixed(entity1, entity2, vector.Right, -vector.Right, false);
static proto PhysicsConeTwistJoint CreateConeTwist(notnull IEntity ent1, IEntity ent2, vector matrix1[4], vector matrix2[4], bool disableCollisions, float breakThreshold = -1)

Creates cone twist joint. Entities must be dynamic objects. Using only ent1 anchors it to the world.

ent1
Entity that will be part of the joint, mandatory
ent2
Other entity that will be part of the joint, optional
matrix1
Joint transformation in reference frame of ent1 (twist is x-axis, swings are z and y axes)
matrix2
Joint transformation in reference frame of ent2 (twist is x-axis, swings are z and y axes)
disableCollisions
True to disable collisions between connected entities
breakThreshold
Maximum impulse to break the joint. Use -1 for unbreakable joint
IEntity entity1 = GetWorld().FindEntityByName("entity1");
IEntity entity2 = GetWorld().FindEntityByName("entity1");
vector mat1[4] = { vector.Right, vector.Up, vector.Forward, vector.Right };
vector mat2[4] = { vector.Right, vector.Up, vector.Forward, -vector.Right };
PhysicsJoint.CreateConeTwist(entity1, entity2, mat1, mat2, false);
static proto PhysicsSliderJoint CreateSlider(notnull IEntity ent1, IEntity ent2, vector matrix1[4], vector matrix2[4], bool disableCollisions, float breakThreshold = -1)

Creates slider joint. Entities must be dynamic objects. Using only ent1 anchors it to the world.

ent1
Entity that will be part of the joint, mandatory
ent2
Other entity that will be part of the joint, optional
matrix1
Joint transformation in reference frame of ent1 (slide is x-axis)
matrix2
Joint transformation in reference frame of ent2 (slide is x-axis)
disableCollisions
True to disable collisions between connected entities
breakThreshold
Maximum impulse to break the joint. Use -1 for unbreakable joint
IEntity entity1 = GetWorld().FindEntityByName("entity1");
IEntity entity2 = GetWorld().FindEntityByName("entity1");
vector mat1[4] = { vector.Right, vector.Up, vector.Forward, vector.Right };
vector mat2[4] = { vector.Right, vector.Up, vector.Forward, -vector.Right };
PhysicsJoint.CreateSlider(entity1, entity2, mat1, mat2, false);
static proto Physics6DOFJoint Create6DOF(notnull IEntity ent1, IEntity ent2, vector matrix1[4], vector matrix2[4], bool disableCollisions, float breakThreshold = -1)

Creates 6 DOF joint. Entities must be dynamic objects. Using only ent1 anchors it to the world.

ent1
Entity that will be part of the joint, mandatory
ent2
Other entity that will be part of the joint, optional
matrix1
Joint transformation in reference frame of ent1
matrix2
Joint transformation in reference frame of ent2
disableCollisions
True to disable collisions between connected entities
breakThreshold
Maximum impulse to break the joint. Use -1 for unbreakable joint
IEntity entity1 = GetWorld().FindEntityByName("entity1");
IEntity entity2 = GetWorld().FindEntityByName("entity1");
vector mat1[4] = { vector.Right, vector.Up, vector.Forward, vector.Right };
vector mat2[4] = { vector.Right, vector.Up, vector.Forward, -vector.Right };
Physics6DOFJoint joint = PhysicsJoint.Create6DOF(entity1, entity2, mat1, mat2, false);
joint.SetLimit(0, -1, 1);
joint.SetAngularLimits(vector.Zero, vector.Zero);
static proto Physics6DOFSpringJoint Create6DOFSpring(notnull IEntity ent1, IEntity ent2, vector matrix1[4], vector matrix2[4], bool disableCollisions, float breakThreshold = -1)

Creates DOF spring joint. Entities must be dynamic objects. Using only ent1 anchors it to the world.

ent1
Entity that will be part of the joint, mandatory
ent2
Other entity that will be part of the joint, optional
matrix1
Joint transformation in reference frame of ent1
matrix2
Joint transformation in reference frame of ent2
disableCollisions
True to disable collisions between connected entities
breakThreshold
Maximum impulse to break the joint. Use -1 for unbreakable joint
IEntity entity1 = GetWorld().FindEntityByName("entity1");
IEntity entity2 = GetWorld().FindEntityByName("entity1");
vector mat1[4] = { vector.Right, vector.Up, vector.Forward, vector.Right };
vector mat2[4] = { vector.Right, vector.Up, vector.Forward, -vector.Right };
Physics6DOFSpringJoint joint = PhysicsJoint.Create6DOF(entity1, entity2, mat1, mat2, false);
joint.SetLimit(0, -1, 1);
joint.SetAngularLimits(vector.Zero, vector.Zero);
joint.SetSpring(0, 1, 1);
proto external void Destroy()

Destroys joint