Hinge

From ActiveWiki
Revision as of 07:35, 16 October 2012 by RoyCurtis (talk | contribs) (mass command page fixes, replaced: → (11), physics object → physical object (2), removed: ==Description==, typos fixed: refernces → references)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Hinge joint demonstrated with a child and parent pair

The hinge command applies a hinge joint to one or more physical objects. When no parent is given, the object will be anchored in world space. A hinge has one free rotate axis only. The hinge action command can only be used on collider objects.

Usage

hinge [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 hinge 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 maximal rotation angle and the strength the hinge tends to return to zero. Valid values for a, the max angle, are between 0.0 and 360 degrees. Valid values for the strength are 0.0 to 1.0. The default is no limit, rotation of 360° and no tendency to return to zero.

parent

The optinal 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 phyiscs objects.

Notes

  • When building a chain of joints, and editing an object that is child and has a parent, the chain will be lost temporary. 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 mass=1, hinge limit="90 1"

This is a typical simple hinge for a door.

create collider mass=4, hinge pin="1 0 0" limit="15 .75"

A swing or catapult.

create name objA, collider
create collider, hinge parent=objA

This is a fixed joint of two objects.

create name objA, collider, hinge 0 2 0
create collider, hinge pin="0 0 1" parent=objA limit="30 .9"

This is a flexible joint of two objects, and objA is ancered in world space 2 meters up from the object's pivot.

create name objA, collider
create name objB, collider, hinge parent=objA
create name objC, collider, hinge parent=objB
create collider, hinge parent=objC

This makes a chain of 4 physical objects.

Object Scripting

Triggers: CreateBumpActivateAdoneAtCollideSdoneEnter ZoneExit Zone

Commands: AddforceAddtorqueAlpharefAnimateAstartAstopCameraColliderColltagColorCoronaEnviExamineFrameGroupLightLinkLockMatfxMediaMidiMoveNameNoiseOpacityPictureRotateSayScale SeqShadowShearSignSkewSkyboxSolidSoundTagTeleport / TeleportxTextureTimerURLVelocityVisibleWarpWeb