Module KX_ObjectActuator

Source Code for Module KX_ObjectActuator

  1  # $Id: KX_ObjectActuator.py 2615 2004-06-02 12:43:27Z kester $ 
  2  # Documentation for KX_ObjectActuator 
  3  from SCA_IActuator import * 
  4   
5 -class KX_ObjectActuator(SCA_IActuator):
6 """ 7 The object actuator ("Motion Actuator") applies force, torque, displacement, angular displacement, 8 velocity, or angular velocity to an object. 9 """
10 - def getForce():
11 """ 12 Returns the force applied by the actuator. 13 14 @rtype: list [fx, fy, fz, local] 15 @return: A four item list, containing the vector force, and a flag specifying whether the force is local. 16 """
17 - def setForce(fx, fy, fz, local):
18 """ 19 Sets the force applied by the actuator. 20 21 @type fx: float 22 @param fx: the x component of the force. 23 @type fy: float 24 @param fy: the z component of the force. 25 @type fz: float 26 @param fz: the z component of the force. 27 @type local: boolean 28 @param local: - False: the force is applied in world coordinates. 29 - True: the force is applied in local coordinates. 30 """
31 - def getTorque():
32 """ 33 Returns the torque applied by the actuator. 34 35 @rtype: list [S{Tau}x, S{Tau}y, S{Tau}z, local] 36 @return: A four item list, containing the vector torque, and a flag specifying whether 37 the torque is applied in local coordinates (True) or world coordinates (False) 38 """
39 - def setTorque(tx, ty, tz, local):
40 """ 41 Sets the torque applied by the actuator. 42 43 @type tx: float 44 @param tx: the x component of the torque. 45 @type ty: float 46 @param ty: the z component of the torque. 47 @type tz: float 48 @param tz: the z component of the torque. 49 @type local: boolean 50 @param local: - False: the torque is applied in world coordinates. 51 - True: the torque is applied in local coordinates. 52 """
53 - def getDLoc():
54 """ 55 Returns the displacement vector applied by the actuator. 56 57 @rtype: list [dx, dy, dz, local] 58 @return: A four item list, containing the vector displacement, and whether 59 the displacement is applied in local coordinates (True) or world 60 coordinates (False) 61 """
62 - def setDLoc(dx, dy, dz, local):
63 """ 64 Sets the displacement vector applied by the actuator. 65 66 Since the displacement is applied every frame, you must adjust the displacement 67 based on the frame rate, or you game experience will depend on the player's computer 68 speed. 69 70 @type dx: float 71 @param dx: the x component of the displacement vector. 72 @type dy: float 73 @param dy: the z component of the displacement vector. 74 @type dz: float 75 @param dz: the z component of the displacement vector. 76 @type local: boolean 77 @param local: - False: the displacement vector is applied in world coordinates. 78 - True: the displacement vector is applied in local coordinates. 79 """
80 - def getDRot():
81 """ 82 Returns the angular displacement vector applied by the actuator. 83 84 @rtype: list [dx, dy, dz, local] 85 @return: A four item list, containing the angular displacement vector, and whether 86 the displacement is applied in local coordinates (True) or world 87 coordinates (False) 88 """
89 - def setDRot(dx, dy, dz, local):
90 """ 91 Sets the angular displacement vector applied by the actuator. 92 93 Since the displacement is applied every frame, you must adjust the displacement 94 based on the frame rate, or you game experience will depend on the player's computer 95 speed. 96 97 @type dx: float 98 @param dx: the x component of the angular displacement vector. 99 @type dy: float 100 @param dy: the z component of the angular displacement vector. 101 @type dz: float 102 @param dz: the z component of the angular displacement vector. 103 @type local: boolean 104 @param local: - False: the angular displacement vector is applied in world coordinates. 105 - True: the angular displacement vector is applied in local coordinates. 106 """
107 - def getLinearVelocity():
108 """ 109 Returns the linear velocity applied by the actuator. 110 111 @rtype: list [vx, vy, vz, local] 112 @return: A four item list, containing the vector velocity, and whether 113 the velocity is applied in local coordinates (True) or world 114 coordinates (False) 115 """
116 - def setLinearVelocity(vx, vy, vz, local):
117 """ 118 Sets the linear velocity applied by the actuator. 119 120 @type vx: float 121 @param vx: the x component of the velocity vector. 122 @type vy: float 123 @param vy: the z component of the velocity vector. 124 @type vz: float 125 @param vz: the z component of the velocity vector. 126 @type local: boolean 127 @param local: - False: the velocity vector is applied in world coordinates. 128 - True: the velocity vector is applied in local coordinates. 129 """
130 - def getAngularVelocity():
131 """ 132 Returns the angular velocity applied by the actuator. 133 134 @rtype: list [S{omega}x, S{omega}y, S{omega}z, local] 135 @return: A four item list, containing the vector velocity, and whether 136 the velocity is applied in local coordinates (True) or world 137 coordinates (False) 138 """
139 - def setAngularVelocity(wx, wy, wz, local):
140 """ 141 Sets the angular velocity applied by the actuator. 142 143 @type wx: float 144 @param wx: the x component of the velocity vector. 145 @type wy: float 146 @param wy: the z component of the velocity vector. 147 @type wz: float 148 @param wz: the z component of the velocity vector. 149 @type local: boolean 150 @param local: - False: the velocity vector is applied in world coordinates. 151 - True: the velocity vector is applied in local coordinates. 152 """
153