Module KX_ConstraintActuator :: Class KX_ConstraintActuator
[hide private]
[frames] | no frames]

Class KX_ConstraintActuator

source code

SCA_ILogicBrick.SCA_ILogicBrick --+    
                                  |    
        SCA_IActuator.SCA_IActuator --+
                                      |
                                     KX_ConstraintActuator

A constraint actuator limits the position, rotation, distance or orientation of an object.

Instance Methods [hide private]
 
setDamp(time)
Sets the time this constraint is delayed.
source code
integer
getDamp()
Returns the damping time of the constraint.
source code
 
setMin(lower)
Sets the lower bound of the constraint.
source code
float
getMin()
Gets the lower bound of the constraint.
source code
 
setMax(upper)
Sets the upper bound of the constraint.
source code
float
getMax()
Gets the upper bound of the constraint.
source code
 
setLimit(limit)
Sets the type of constraint.
source code
 
getLimit()
Gets the type of constraint.
source code
 
setRotDamp(duration)
Sets the time constant of the orientation constraint.
source code
integer
getRotDamp()
Returns the damping time for application of the constraint.
source code
 
setDirection(vector)
Sets the reference direction in world coordinate for the orientation constraint
source code
3-tuple
getDirection()
Returns the reference direction of the orientation constraint in world coordinate.
source code
 
setOption(option)
Sets several options of the distance constraint.
source code
integer
getOption()
Returns the option parameter.
source code
 
setTime(duration)
Sets the activation time of the actuator.
source code
integer
getTime()
Returns the time parameter.
source code
 
setProperty(property)
Sets the name of the property or material for the ray detection of the distance constraint.
source code
string
getProperty()
Returns the property parameter.
source code
 
setDistance(distance)
Sets the target distance in distance constraint.
source code
float
getDistance()
Returns the distance parameter.
source code
 
setRayLength(length)
Sets the maximum ray length of the distance constraint.
source code
float
getRayLength()
Returns the length of the ray
source code

Inherited from SCA_ILogicBrick.SCA_ILogicBrick: getExecutePriority, getOwner, setExecutePriority

Method Details [hide private]

setDamp(time)

source code 

Sets the time this constraint is delayed.

Parameters:
  • time (integer) - The number of frames to delay. Negative values are ignored.

setMin(lower)

source code 

Sets the lower bound of the constraint.

For rotational and orientation constraints, lower is specified in degrees.

Parameters:
  • lower (float)

getMin()

source code 

Gets the lower bound of the constraint.

For rotational and orientation constraints, the lower bound is returned in radians.

Returns: float

setMax(upper)

source code 

Sets the upper bound of the constraint.

For rotational and orientation constraints, upper is specified in degrees.

Parameters:
  • upper (float)

getMax()

source code 

Gets the upper bound of the constraint.

For rotational and orientation constraints, the upper bound is returned in radians.

Returns: float

setLimit(limit)

source code 

Sets the type of constraint.

See module GameLogic for valid constraint types.

Parameters:
  • limit - Position constraints: KX_CONSTRAINTACT_LOCX, KX_CONSTRAINTACT_LOCY, KX_CONSTRAINTACT_LOCZ Rotation constraints: KX_CONSTRAINTACT_ROTX, KX_CONSTRAINTACT_ROTY or KX_CONSTRAINTACT_ROTZ Distance contraints: KX_ACT_CONSTRAINT_DIRPX, KX_ACT_CONSTRAINT_DIRPY, KX_ACT_CONSTRAINT_DIRPZ, KX_ACT_CONSTRAINT_DIRNX, KX_ACT_CONSTRAINT_DIRNY, KX_ACT_CONSTRAINT_DIRNZ Orientation constraints: KX_ACT_CONSTRAINT_ORIX, KX_ACT_CONSTRAINT_ORIY, KX_ACT_CONSTRAINT_ORIZ

getLimit()

source code 

Gets the type of constraint.

See module GameLogic for valid constraints.

Returns:
Position constraints: KX_CONSTRAINTACT_LOCX, KX_CONSTRAINTACT_LOCY, KX_CONSTRAINTACT_LOCZ, Rotation constraints: KX_CONSTRAINTACT_ROTX, KX_CONSTRAINTACT_ROTY, KX_CONSTRAINTACT_ROTZ, Distance contraints: KX_ACT_CONSTRAINT_DIRPX, KX_ACT_CONSTRAINT_DIRPY, KX_ACT_CONSTRAINT_DIRPZ, KX_ACT_CONSTRAINT_DIRNX, KX_ACT_CONSTRAINT_DIRNY, KX_ACT_CONSTRAINT_DIRNZ, Orientation constraints: KX_ACT_CONSTRAINT_ORIX, KX_ACT_CONSTRAINT_ORIY, KX_ACT_CONSTRAINT_ORIZ

setRotDamp(duration)

source code 

Sets the time constant of the orientation constraint.

Parameters:
  • duration (integer) - If the duration is negative, it is set to 0.

setDirection(vector)

source code 

Sets the reference direction in world coordinate for the orientation constraint

Parameters:
  • vector (3-tuple)

setOption(option)

source code 

Sets several options of the distance constraint.

Parameters:
  • option (integer) - Binary combination of the following values: 64 : Activate alignment to surface 128 : Detect material rather than property 256 : No deactivation if ray does not hit target 512 : Activate distance control

setTime(duration)

source code 

Sets the activation time of the actuator.

Parameters:
  • duration (integer) - The actuator disables itself after this many frame. If set to 0 or negative, the actuator is not limited in time.

setProperty(property)

source code 

Sets the name of the property or material for the ray detection of the distance constraint.

Parameters:
  • property (string) - If empty, the ray will detect any collisioning object.

setDistance(distance)

source code 

Sets the target distance in distance constraint.

Parameters:
  • distance (float)

setRayLength(length)

source code 

Sets the maximum ray length of the distance constraint.

Parameters:
  • length (float)