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



Introduced in

Version:1.44

Description

Description: Creates a spherical joint between two objects with specified parameters. Also known as a Ball and Socket joint. (Forward/Back,Up/Down, and Left/Right movement locked, Yaw, Pitch, and Roll movement unlocked.)

Illustration of a Sphere Joint.

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 - ["SphereJoint",fromPose,toPose,misc,jointDesc]
    • fromPose: Array - [pos,axis]
    • 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)
      • axis: Vector3D or String - joint connection axis in model coordinates or memory point name. (default = connectionChildAxis memory point or up vector 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))
      • projDist: Number - Max projection distance. (default = -1 ... disabled, range = <0,+inf))
    • jointDesc: Array - [limits,springs] - Sphere joint description
      • limits: Array - [twistLowLimit,twistHighLimit,swingLimit] - joint limits
        • twistLowLimit,twistHighLimit,swingLimit: Array - [restitution,value] - joint limit parameters
          • restitution: Number - limit bounce (default = -1 ... joint limit disabled, range = <0,1>))
          • value: Number - The angle beyond which the limit is active (default = 0, range = angular (-pi,+pi>).
      • springs: Array - [twistSpring,swingSpring,jointSpring] - joint springs
        • twistSpring,swingSpring,jointSpring: 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 angle of spring where the spring force is zero. (default = 0, range = angular (-pi,+pi>)
Return Value: Joint

Examples

Examples: Limits and spring: (any truck and trailer can be used for a quick test)
jointType = "SphereJoint";
fromPose = [ ];
toPose = [ ];
misc = [ ];
twistLowLimit = [0,-0.5];
twistHighLimit = [0,0.5];
swingLimit = [0.5,1.0];
limits = [twistLowLimit,twistHighLimit,swingLimit];
swingSpring = [1,200,0,0.5];
springs = [ [ ] ,swingSpring];
jointDesc = [limits,springs];
MyJoint = [TRUCK,TRAILER] createJointExt [jointType,fromPose,toPose,misc,jointDesc];

Additional Information

See also: createJointExt, deleteJointExt
Multiplayer: 
Problems: 

Notes