Moai SDK  1.5 revision 1 (MoaiEdition)
MOAICpConstraint Class Reference

Inherits MOAILuaObject, and MOAICpPrim.

List of all members.

Function List

  getBiasCoef
  getMaxBias
  getMaxForce
  newDampedRotarySpring
  newDampedSpring
  newGearJoint
  newGrooveJoint
  newPinJoint
  newPivotJoint
  newRatchetJoint
  newRotaryLimitJoint
  newSimpleMotor
  newSlideJoint
  setBiasCoef
  setMaxBias
  setMaxForce

Function Documentation

Returns the current bias coefficient.


function getBiasCoef ( MOAICpConstraint self )
Parameters:
self ( MOAICpConstraint )
Returns:
bias ( number )

Returns the maximum bias coefficient.


function getMaxBias ( MOAICpConstraint self )
Parameters:
self ( MOAICpConstraint )
Returns:
bias ( number )

Returns the maximum force allowed.


function getMaxForce ( MOAICpConstraint self )
Parameters:
self ( MOAICpConstraint )
Returns:
bias ( number )

Creates a new damped rotary string between the two specified bodies.


function newDampedRotarySpring ( MOAICpBody first, MOAICpBody second, number restAngle, number stiffness, number damping )
Parameters:
first ( MOAICpBody )
second ( MOAICpBody )
restAngle ( number ) The angle at which the spring is at rest.
stiffness ( number ) The stiffness of the spring.
damping ( number ) The damping applied to the spring.
Returns:
spring ( MOAICpConstraint )

Creates a new damped string between the two specified bodies.


function newDampedSpring ( MOAICpBody first, MOAICpBody second, number x1, number y1, number x2, number y2, number restAngle, number stiffness, number damping )
Parameters:
first ( MOAICpBody )
second ( MOAICpBody )
x1 ( number ) The X position of the first anchor.
y1 ( number ) The Y position of the first anchor.
x2 ( number ) The X position of the second anchor.
y2 ( number ) The Y position of the second anchor.
restAngle ( number ) The angle at which the spring is at rest.
stiffness ( number ) The stiffness of the spring.
damping ( number ) The damping applied to the spring.
Returns:
spring ( MOAICpConstraint )

Creates a new gear joint between the two specified bodies.


function newGearJoint ( MOAICpBody first, MOAICpBody second, number phase, number ratio )
Parameters:
first ( MOAICpBody )
second ( MOAICpBody )
phase ( number ) The phase of the gear.
ratio ( number ) The gear ratio.
Returns:
gear ( MOAICpConstraint )

Creates a new groove joint between the two specified bodies.


function newGrooveJoint ( MOAICpBody first, MOAICpBody second, number gx1, number gy1, number gx2, number gy2, number ax, number ay )
Parameters:
first ( MOAICpBody )
second ( MOAICpBody )
gx1 ( number )
gy1 ( number )
gx2 ( number )
gy2 ( number )
ax ( number )
ay ( number )
Returns:
groove ( MOAICpConstraint )

Creates a new pin joint between the two specified bodies.


function newPinJoint ( MOAICpBody first, MOAICpBody second, number ax1, number ay1, number ax2, number ay2 )
Parameters:
first ( MOAICpBody )
second ( MOAICpBody )
ax1 ( number )
ay1 ( number )
ax2 ( number )
ay2 ( number )
Returns:
pin ( MOAICpConstraint )

Creates a new pivot joint between the two specified bodies.


function newPivotJoint ( MOAICpBody first, MOAICpBody second, number x, number y [, number ax, number ay ] )
Parameters:
first ( MOAICpBody )
second ( MOAICpBody )
x ( number )
y ( number )
ax ( number ) Optional.
ay ( number ) Optional.
Returns:
pivot ( MOAICpConstraint )

Creates a new ratchet joint between the two specified bodies.


function newRatchetJoint ( MOAICpBody first, MOAICpBody second, number phase, number ratchet )
Parameters:
first ( MOAICpBody )
second ( MOAICpBody )
phase ( number ) The phase of the gear.
ratchet ( number ) The ratchet value.
Returns:
ratchet ( MOAICpConstraint )

Creates a new rotary limit joint between the two specified bodies.


function newRotaryLimitJoint ( MOAICpBody first, MOAICpBody second, number min, number max )
Parameters:
first ( MOAICpBody )
second ( MOAICpBody )
min ( number ) The minimum rotary value.
max ( number ) The maximum rotary value.
Returns:
limit ( MOAICpConstraint )

Creates a new simple motor joint between the two specified bodies.


function newSimpleMotor ( MOAICpBody first, MOAICpBody second, number rate )
Parameters:
first ( MOAICpBody )
second ( MOAICpBody )
rate ( number ) The rotation rate of the simple motor.
Returns:
motor ( MOAICpConstraint )

Creates a new slide joint between the two specified bodies.


function newSlideJoint ( MOAICpBody first, MOAICpBody second, number ax1, number ay1, number ax2, number ay2, number min, number max )
Parameters:
first ( MOAICpBody )
second ( MOAICpBody )
ax1 ( number )
ay1 ( number )
ax2 ( number )
ay2 ( number )
min ( number )
max ( number )
Returns:
motor ( MOAICpConstraint )

Sets the current bias coefficient.


function setBiasCoef ( MOAICpConstraint self, number bias )
Parameters:
self ( MOAICpConstraint )
bias ( number ) The bias coefficient.
Returns:
nil

Sets the maximum bias coefficient.


function setMaxBias ( MOAICpConstraint self, number bias )
Parameters:
self ( MOAICpConstraint )
bias ( number ) The maximum bias coefficient.
Returns:
nil

Sets the maximum force allowed.


function setMaxForce ( MOAICpConstraint self, number bias )
Parameters:
self ( MOAICpConstraint )
bias ( number ) The maximum force allowed.
Returns:
nil