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

Class KX_ConstraintActuator

source code

PyObjectPlus --+            
               |            
          CValue --+        
                   |        
     SCA_ILogicBrick --+    
                       |    
           SCA_IActuator --+
                           |
                          KX_ConstraintActuator

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

Properties:

Instance Methods [hide private]
    Deprecated
 
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
integer
getExecutePriority()
Gets the execution priority of this logic brick.
source code
KX_GameObject
getOwner()
Gets the game object associated with this logic brick.
source code
 
setExecutePriority(priority)
Sets the priority of this logic brick.
source code
    Inherited from CValue
string
getName()
Returns the name of the CValue.
source code
    Inherited from PyObjectPlus
bool
isA(game_type)
Check if this is a type or a subtype game_type.
source code
Instance Variables [hide private]
integer damp
time constant of the constraint expressed in frame (not use by Force field constraint)
3-tuple of float: [x,y,z] direction
the reference direction in world coordinate for the orientation constraint
float distance
the target distance of the distance constraint
integer limit
type of constraint, use one of the following constant: KX_ACT_CONSTRAINT_LOCX ( 1) : limit X coord KX_ACT_CONSTRAINT_LOCY ( 2) : limit Y coord KX_ACT_CONSTRAINT_LOCZ ( 3) : limit Z coord KX_ACT_CONSTRAINT_ROTX ( 4) : limit X rotation KX_ACT_CONSTRAINT_ROTY ( 5) : limit Y rotation KX_ACT_CONSTRAINT_ROTZ ( 6) : limit Z rotation KX_ACT_CONSTRAINT_DIRPX ( 7) : set distance along positive X axis KX_ACT_CONSTRAINT_DIRPY ( 8) : set distance along positive Y axis KX_ACT_CONSTRAINT_DIRPZ ( 9) : set distance along positive Z axis KX_ACT_CONSTRAINT_DIRNX (10) : set distance along negative X axis KX_ACT_CONSTRAINT_DIRNY (11) : set distance along negative Y axis KX_ACT_CONSTRAINT_DIRNZ (12) : set distance along negative Z axis KX_ACT_CONSTRAINT_ORIX (13) : set orientation of X axis KX_ACT_CONSTRAINT_ORIY (14) : set orientation of Y axis KX_ACT_CONSTRAINT_ORIZ (15) : set orientation of Z axis KX_ACT_CONSTRAINT_FHPX (16) : set force field along positive X axis KX_ACT_CONSTRAINT_FHPY (17) : set force field along positive Y axis KX_ACT_CONSTRAINT_FHPZ (18) : set force field along positive Z axis KX_ACT_CONSTRAINT_FHNX (19) : set force field along negative X axis KX_ACT_CONSTRAINT_FHNY (20) : set force field along negative Y axis KX_ACT_CONSTRAINT_FHNZ (21) : set force field along negative Z axis
float max
the upper bound of the constraint.
float min
The lower bound of the constraint For the rotation and orientation constraint, it represents radiant
integer option
Binary combination of the following values: Applicable to Distance constraint:
string propName
the name of the property or material for the ray detection of the distance constraint.
float rayLength
the length of the ray of the distance constraint.
integer rotDamp
time constant for the rotation expressed in frame (only for the distance constraint) 0 = use damp for rotation as well
integer time
activation time of the actuator.
    Inherited from SCA_ILogicBrick
int executePriority
This determines the order controllers are evaluated, and actuators are activated (lower priority is executed first).
string name
The name of this CValue derived object (read-only).
KX_GameObject or None in exceptional cases. owner
The game object this logic brick is attached to (read-only).
    Inherited from PyObjectPlus
bool invalid
Test if the object has been freed by the game engine and is no longer valid.
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.

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.

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

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.

setRayLength(length)

source code 
Sets the maximum ray length of the distance constraint.

Instance Variable Details [hide private]

max

the upper bound of the constraint. For rotation and orientation constraints, it represents radiant.
Type:
float

option

Binary combination of the following values: Applicable to Distance constraint:
  • KX_ACT_CONSTRAINT_NORMAL ( 64) : Activate alignment to surface
  • KX_ACT_CONSTRAINT_DISTANCE ( 512) : Activate distance control
  • KX_ACT_CONSTRAINT_LOCAL (1024) : direction of the ray is along the local axis
Applicable to Force field constraint:
  • KX_ACT_CONSTRAINT_DOROTFH (2048) : Force field act on rotation as well
Applicable to both:
  • KX_ACT_CONSTRAINT_MATERIAL ( 128) : Detect material rather than property
  • KX_ACT_CONSTRAINT_PERMANENT ( 256) : No deactivation if ray does not hit target
Type:
integer

time

activation time of the actuator. The actuator disables itself after this many frame. If set to 0, the actuator is not limited in time.
Type:
integer