AddHavokBallAndSocketConstraint - Game

Revision as of 18:25, 11 May 2012 by imported>Chesko

Member of: Game Script

Adds a constraint between two rigid bodies of two references

Syntax

bool Function AddHavokBallAndSocketConstraint(ObjectReference arRefA, string arRefANode, ObjectReference arRefB, string arRefBNode, \
    float afRefALocalOffsetX = 0.0, float afRefALocalOffsetY = 0.0, float afRefALocalOffsetZ = 0.0, float afRefBLocalOffsetX = 0.0, \
    float afRefBLocalOffsetY = 0.0, float afRefBLocalOffsetZ = 0.0) native global

Parameters

  • arRefA: The first reference
  • arRefANode: The rigid body name on the first reference for the constraint
  • arRefB: The second reference
  • arRefBNode: The rigid body name on the second reference for the constraint
  • afRefALocalOffsetX: The offset of the constraint in the first body's space, X
    • Default: 0.0
  • afRefALocalOffsetY: The offset of the constraint in the first body's space, Y
    • Default: 0.0
  • afRefALocalOffsetZ: The offset of the constraint in the first body's space, Z
    • Default: 0.0
  • afRefBLocalOffsetX: The offset of the constraint in the second body's space, X
    • Default: 0.0
  • afRefBLocalOffsetY: The offset of the constraint in the second body's space, Y
    • Default: 0.0
  • afRefBLocalOffsetZ: The offset of the constraint in the second body's space, Z
    • Default: 0.0

Return Value

True on success.

Examples

; Add a ball and socket constraint between bob and sally's hand nodes
Game.AddHavokBallAndSocketConstraint(Bob, "Hand", Sally, "Hand")


; Add a ball and socket constraint between bob and sally's hand nodes with an offset of 1,1,1 in the first body's space
Game.AddHavokBallAndSocketConstraint(Bob, "Hand", Sally, "Hand", 1.0, 1.0, 1.0)

Notes

  • The nodes referenced must contain a bhkCollisionObject node, which in turn must contain a bhkRigidBody node.
  • You can only add a ball and socket constraint on dead actors, or live actors that are in the process of "ragdolling" from PushActorAway - ObjectReference or some other physics impact. When the live actor gets back up, the constraint will be broken.

See Also