Page tree
Skip to end of metadata
Go to start of metadata



Introduced in

Version:1.44

Description

Description: Creates a distance joint between two objects with specified parameters. (Forward/Back,Up/Down, and Left/Right movement unlocked, Yaw, Pitch, and Roll movement locked.)
For more information on other joints see createJointExt

Syntax

Syntax: objects createJointExt jointParameters
Parameters:
  • objects: Array - [fromObj,toObj]
    • fromObj,toObj: Object - both connected objects
  • jointParameters: Array - ["DistanceJoint",fromPose,toPose,misc,jointDesc]
    • fromPose: Array - [pos]
    • toPose: Array - [pos]
      • pos: Vector3D or String - joint connection point in model coordinates or memory point name. (default = connectionChild/connectionParent memory point or [0,0,0] if not defined)
    • misc: Array - [collisions,breakForce,projDist] - array of miscelaneous parameters
      • collisions: Boolean - Flag to determine if we want to have enabled collisions between connected objects. (default = false, range = [true,false])
      • breakForce: Number - Force needed to break a joint connection in Newtons (default = -1 ... disabled, range = <0,+inf))
    • jointDesc: Array - [limits,springs] - Distance joint description
      • limits: Array - [minDist,maxDist] - joint limits
        • minDist,maxDist: Array - [dist] - joint limit parameters
          • dist: Number - distance (default = -1 ... joint limit disabled, rangeMinDist = (0,maxDist>, rangeMaxDist = <minDist,+inf))
      • springs: Array - [spring] - joint spring description
        • spring: Array - [enabled,spring,damping,value] - joint spring parameters
          • enabled: Number - Flag to determine if we want to enable that spring (default = 0, range = [0,1])
          • spring: Number - spring coefficient (default = 0, range = <0,+inf))
          • damping: Number - damper coefficient (default = 0, range = <0,+inf))
          • value: Number - target position of spring where the spring force is zero. (default = 0, range = linear (-inf,+inf))
Return Value: Joint

Examples

Examples: Spring with lenght 3, min length = 2 and max length = 5: (two hummers can be used for a quick test)
jointType = "DistanceJoint";
fromPose = [ [0,-3,0] ];
toPose = [ [0,3,0] ];
misc = [ ];
minDist = [2];
maxDist = [5];
dists = [minDist,maxDist];
spring = [1,20,0,3];
springs = [spring];
jointDesc = [dists,springs];
MyJoint = [HMMWV1,HMMWV2] createJointExt [jointType,fromPose,toPose,misc,jointDesc];

Additional Information

See also: createJointExt, deleteJointExt
Multiplayer: 
Problems: 

Notes