1
# $Id: KX_ConstraintActuator.py 17083 2008-10-14 22:31:10Z campbellbarton $
2
# Documentation for KX_ConstraintActuator
3
from SCA_IActuator import *
5
class KX_ConstraintActuator(SCA_IActuator):
7
A constraint actuator limits the position, rotation, distance or orientation of an object.
11
Sets the time this constraint is delayed.
13
@param time: The number of frames to delay.
14
Negative values are ignored.
19
Returns the damping time of the constraint.
25
Sets the lower bound of the constraint.
27
For rotational and orientation constraints, lower is specified in degrees.
33
Gets the lower bound of the constraint.
35
For rotational and orientation constraints, the lower bound is returned in radians.
41
Sets the upper bound of the constraint.
43
For rotational and orientation constraints, upper is specified in degrees.
49
Gets the upper bound of the constraint.
51
For rotational and orientation constraints, the upper bound is returned in radians.
57
Sets the type of constraint.
59
See module L{GameLogic} for valid constraint types.
62
Position constraints: KX_CONSTRAINTACT_LOCX, KX_CONSTRAINTACT_LOCY, KX_CONSTRAINTACT_LOCZ
63
Rotation constraints: KX_CONSTRAINTACT_ROTX, KX_CONSTRAINTACT_ROTY or KX_CONSTRAINTACT_ROTZ
64
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
65
Orientation constraints: KX_ACT_CONSTRAINT_ORIX, KX_ACT_CONSTRAINT_ORIY, KX_ACT_CONSTRAINT_ORIZ
69
Gets the type of constraint.
71
See module L{GameLogic} for valid constraints.
74
Position constraints: KX_CONSTRAINTACT_LOCX, KX_CONSTRAINTACT_LOCY, KX_CONSTRAINTACT_LOCZ,
75
Rotation constraints: KX_CONSTRAINTACT_ROTX, KX_CONSTRAINTACT_ROTY, KX_CONSTRAINTACT_ROTZ,
76
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,
77
Orientation constraints: KX_ACT_CONSTRAINT_ORIX, KX_ACT_CONSTRAINT_ORIY, KX_ACT_CONSTRAINT_ORIZ
79
def setRotDamp(duration):
81
Sets the time constant of the orientation constraint.
83
@param duration: If the duration is negative, it is set to 0.
84
@type duration: integer
88
Returns the damping time for application of the constraint.
92
def setDirection(vector):
94
Sets the reference direction in world coordinate for the orientation constraint
100
Returns the reference direction of the orientation constraint in world coordinate.
104
def setOption(option):
106
Sets several options of the distance constraint.
108
@type option: integer
109
@param option: Binary combination of the following values:
110
64 : Activate alignment to surface
111
128 : Detect material rather than property
112
256 : No deactivation if ray does not hit target
113
512 : Activate distance control
117
Returns the option parameter.
121
def setTime(duration):
123
Sets the activation time of the actuator.
125
@type duration: integer
126
@param duration: The actuator disables itself after this many frame.
127
If set to 0 or negative, the actuator is not limited in time.
131
Returns the time parameter.
135
def setProperty(property):
137
Sets the name of the property or material for the ray detection of the distance constraint.
139
@type property: string
140
@param property: If empty, the ray will detect any collisioning object.
144
Returns the property parameter.
148
def setDistance(distance):
150
Sets the target distance in distance constraint.
152
@type distance: float
156
Returns the distance parameter.
160
def setRayLength(length):
162
Sets the maximum ray length of the distance constraint.
168
Returns the length of the ray