Module KX_ObjectActuator :: Class KX_ObjectActuator

Class KX_ObjectActuator

SCA_ILogicBrick.SCA_ILogicBrick --+    
                                  |    
        SCA_IActuator.SCA_IActuator --+
                                      |
                                     KX_ObjectActuator

The object actuator ("Motion Actuator") applies force, torque, displacement, angular displacement, velocity, or angular velocity to an object. Servo control allows to regulate force to achieve a certain speed target.

Instance Methods
list [fx, fy, fz, local]
getForce()
Returns the force applied by the actuator.
 
setForce(fx, fy, fz, local)
Sets the force applied by the actuator.
list [Τx, Τy, Τz, local]
getTorque()
Returns the torque applied by the actuator.
 
setTorque(tx, ty, tz, local)
Sets the torque applied by the actuator.
list [dx, dy, dz, local]
getDLoc()
Returns the displacement vector applied by the actuator.
 
setDLoc(dx, dy, dz, local)
Sets the displacement vector applied by the actuator.
list [dx, dy, dz, local]
getDRot()
Returns the angular displacement vector applied by the actuator.
 
setDRot(dx, dy, dz, local)
Sets the angular displacement vector applied by the actuator.
list [vx, vy, vz, local]
getLinearVelocity()
Returns the linear velocity applied by the actuator.
 
setLinearVelocity(vx, vy, vz, local)
Sets the linear velocity applied by the actuator.
list [ωx, ωy, ωz, local]
getAngularVelocity()
Returns the angular velocity applied by the actuator.
 
setAngularVelocity(wx, wy, wz, local)
Sets the angular velocity applied by the actuator.
integer
getDamping()
Returns the damping parameter of the servo controller.
 
setDamping(damp)
Sets the damping parameter of the servo controller.
list [min, max, enabled]
getForceLimitX()
Returns the min/max force limit along the X axis used by the servo controller.
 
setForceLimitX(min, max, enable)
Sets the min/max force limit along the X axis and activates or deactivates the limits in the servo controller.
list [min, max, enabled]
getForceLimitY()
Returns the min/max force limit along the Y axis used by the servo controller.
 
setForceLimitY(min, max, enable)
Sets the min/max force limit along the Y axis and activates or deactivates the limits in the servo controller.
list [min, max, enabled]
getForceLimitZ()
Returns the min/max force limit along the Z axis used by the servo controller.
 
setForceLimitZ(min, max, enable)
Sets the min/max force limit along the Z axis and activates or deactivates the limits in the servo controller.
list [P, I, D]
getPID()
Returns the PID coefficient of the servo controller.
 
setPID(P, I, D)
Sets the PID coefficients of the servo controller.
integer
getExecutePriority()
Gets the execution priority of this logic brick. (Inherited from SCA_ILogicBrick.SCA_ILogicBrick)
KX_GameObject
getOwner()
Gets the game object associated with this logic brick. (Inherited from SCA_ILogicBrick.SCA_ILogicBrick)
 
setExecutePriority(priority)
Sets the priority of this logic brick. (Inherited from SCA_ILogicBrick.SCA_ILogicBrick)
Instance Variables
int executePriority
This determines the order controllers are evaluated, and actuators are activated (lower priority is executed first). (Inherited from SCA_ILogicBrick.SCA_ILogicBrick)
KX_GameObject or None in exceptional cases. owner
The game object this logic brick is attached to (read only). (Inherited from SCA_ILogicBrick.SCA_ILogicBrick)
Method Details

getForce()

 

Returns the force applied by the actuator.

Returns: list [fx, fy, fz, local]
A four item list, containing the vector force, and a flag specifying whether the force is local.

setForce(fx, fy, fz, local)

 

Sets the force applied by the actuator.

Parameters:
  • fx (float) - the x component of the force.
  • fy (float) - the z component of the force.
  • fz (float) - the z component of the force.
  • local (boolean) - - False: the force is applied in world coordinates.
    • True: the force is applied in local coordinates.

getTorque()

 

Returns the torque applied by the actuator.

Returns: list [Τx, Τy, Τz, local]
A four item list, containing the vector torque, and a flag specifying whether the torque is applied in local coordinates (True) or world coordinates (False)

setTorque(tx, ty, tz, local)

 

Sets the torque applied by the actuator.

Parameters:
  • tx (float) - the x component of the torque.
  • ty (float) - the z component of the torque.
  • tz (float) - the z component of the torque.
  • local (boolean) - - False: the torque is applied in world coordinates.
    • True: the torque is applied in local coordinates.

getDLoc()

 

Returns the displacement vector applied by the actuator.

Returns: list [dx, dy, dz, local]
A four item list, containing the vector displacement, and whether the displacement is applied in local coordinates (True) or world coordinates (False)

setDLoc(dx, dy, dz, local)

 

Sets the displacement vector applied by the actuator.

Since the displacement is applied every frame, you must adjust the displacement based on the frame rate, or you game experience will depend on the player's computer speed.

Parameters:
  • dx (float) - the x component of the displacement vector.
  • dy (float) - the z component of the displacement vector.
  • dz (float) - the z component of the displacement vector.
  • local (boolean) - - False: the displacement vector is applied in world coordinates.
    • True: the displacement vector is applied in local coordinates.

getDRot()

 

Returns the angular displacement vector applied by the actuator.

Returns: list [dx, dy, dz, local]
A four item list, containing the angular displacement vector, and whether the displacement is applied in local coordinates (True) or world coordinates (False)

setDRot(dx, dy, dz, local)

 

Sets the angular displacement vector applied by the actuator.

Since the displacement is applied every frame, you must adjust the displacement based on the frame rate, or you game experience will depend on the player's computer speed.

Parameters:
  • dx (float) - the x component of the angular displacement vector.
  • dy (float) - the z component of the angular displacement vector.
  • dz (float) - the z component of the angular displacement vector.
  • local (boolean) - - False: the angular displacement vector is applied in world coordinates.
    • True: the angular displacement vector is applied in local coordinates.

getLinearVelocity()

 

Returns the linear velocity applied by the actuator. For the servo control actuator, this is the target speed.

Returns: list [vx, vy, vz, local]
A four item list, containing the vector velocity, and whether the velocity is applied in local coordinates (True) or world coordinates (False)

setLinearVelocity(vx, vy, vz, local)

 

Sets the linear velocity applied by the actuator. For the servo control actuator, sets the target speed.

Parameters:
  • vx (float) - the x component of the velocity vector.
  • vy (float) - the z component of the velocity vector.
  • vz (float) - the z component of the velocity vector.
  • local (boolean) - - False: the velocity vector is in world coordinates.
    • True: the velocity vector is in local coordinates.

getAngularVelocity()

 

Returns the angular velocity applied by the actuator.

Returns: list [ωx, ωy, ωz, local]
A four item list, containing the vector velocity, and whether the velocity is applied in local coordinates (True) or world coordinates (False)

setAngularVelocity(wx, wy, wz, local)

 

Sets the angular velocity applied by the actuator.

Parameters:
  • wx (float) - the x component of the velocity vector.
  • wy (float) - the z component of the velocity vector.
  • wz (float) - the z component of the velocity vector.
  • local (boolean) - - False: the velocity vector is applied in world coordinates.
    • True: the velocity vector is applied in local coordinates.

getDamping()

 

Returns the damping parameter of the servo controller.

Returns: integer
the time constant of the servo controller in frame unit.

setDamping(damp)

 

Sets the damping parameter of the servo controller.

Parameters:
  • damp (integer) - the damping parameter in frame unit.

getForceLimitX()

 

Returns the min/max force limit along the X axis used by the servo controller.

Returns: list [min, max, enabled]
A three item list, containing the min and max limits of the force as float and whether the limits are active(true) or inactive(true)

setForceLimitX(min, max, enable)

 

Sets the min/max force limit along the X axis and activates or deactivates the limits in the servo controller.

Parameters:
  • min (float) - the minimum value of the force along the X axis.
  • max (float) - the maximum value of the force along the X axis.
  • enable (boolean) - - True: the force will be limited to the min/max
    • False: the force will not be limited

getForceLimitY()

 

Returns the min/max force limit along the Y axis used by the servo controller.

Returns: list [min, max, enabled]
A three item list, containing the min and max limits of the force as float and whether the limits are active(true) or inactive(true)

setForceLimitY(min, max, enable)

 

Sets the min/max force limit along the Y axis and activates or deactivates the limits in the servo controller.

Parameters:
  • min (float) - the minimum value of the force along the Y axis.
  • max (float) - the maximum value of the force along the Y axis.
  • enable (boolean) - - True: the force will be limited to the min/max
    • False: the force will not be limited

getForceLimitZ()

 

Returns the min/max force limit along the Z axis used by the servo controller.

Returns: list [min, max, enabled]
A three item list, containing the min and max limits of the force as float and whether the limits are active(true) or inactive(true)

setForceLimitZ(min, max, enable)

 

Sets the min/max force limit along the Z axis and activates or deactivates the limits in the servo controller.

Parameters:
  • min (float) - the minimum value of the force along the Z axis.
  • max (float) - the maximum value of the force along the Z axis.
  • enable (boolean) - - True: the force will be limited to the min/max
    • False: the force will not be limited

getPID()

 

Returns the PID coefficient of the servo controller.

Returns: list [P, I, D]
A three item list, containing the PID coefficient as floats: P : proportional coefficient I : Integral coefficient D : Derivate coefficient

setPID(P, I, D)

 

Sets the PID coefficients of the servo controller.

Parameters:
  • P (flat) - proportional coefficient
  • I (float) - Integral coefficient
  • D (float) - Derivate coefficient