Ballsocket

From ActiveWiki
Jump to navigation Jump to search
Ball and socket joints demonstrated with three balls

The ballsocket command applies a ball and socket joint to one or more physical objects. When no parent is given, the object will be anchored in world space. A ball and socket has two free rotation axes. The ballsocket action command can only be used on collider objects.

Usage

ballsocket [x y z] [pin="x y z"] [limit="a b"] [parent=name]

x y z

The rotation center offset from object's pivot in object space.

pin

pin define the axes of the joint rotation. The values for X Y Z are between 0.0 and 1.0. Any rotation axes in world space is possible. The default joint rotation is around the Y axes, represented in values of "0 1 0".

limit

limit sets the max values for the cone- and twist-angles of the rotation around pivot. Valid values for a and b are between 0.0 and 360 degrees. A value of 0° is equal to 360°, and means no limits are applied. The default is no limit, a rotation of 360° for cone and twist moves.

parent

The optional parent statement references to a name of an object. The first object found in visual range with that name and same build owner will be used as parent for the joint. The parent must be a collider, a physics objects.

Notes

  • When building a chain of joints, and editing an object that is child and has a parent, the chain will be lost temporarily. To rebuild the entire chain either also modify all objects in the chain starting with the lowest child in the hierarchy, or simply move out of visible range and return.

Examples

create collider, ballsocket 0 2 0 pin="0 0 1"

A simple pendulum anchored 2 meters above the object's pivot in world space with not rotation limits set.

create name pend1, collider
create collider, ballsocket pin="0 0 1" limit="180 180" parent=pend1

A pendulum anchored at a parent object and twist and cone rotations limited to 180 degrees.

Object Scripting

Triggers: CreateBumpActivateAdoneAtCollideSdoneEnter ZoneExit Zone

Commands: AddforceAddtorqueAlpharefAnimateAstartAstopCameraColliderColltagColorCoronaEnviExamineFrameGroupLightLinkLockMatfxMediaMidiMoveNameNoiseOpacityPictureRotateSayScale SeqShadowShearSignSkewSkyboxSolidSoundTagTeleport / TeleportxTextureTimerURLVelocityVisibleWarpWeb