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

Class KX_ObjectActuator

source code

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 [hide private]
list [fx, fy, fz, local]
getForce()
Returns the force applied by the actuator.
source code
 
setForce(fx, fy, fz, local)
Sets the force applied by the actuator.
source code
list [Τx, Τy, Τz, local]
getTorque()
Returns the torque applied by the actuator.
source code
 
setTorque(tx, ty, tz, local)
Sets the torque applied by the actuator.
source code
list [dx, dy, dz, local]
getDLoc()
Returns the displacement vector applied by the actuator.
source code
 
setDLoc(dx, dy, dz, local)
Sets the displacement vector applied by the actuator.
source code
list [dx, dy, dz, local]
getDRot()
Returns the angular displacement vector applied by the actuator.
source code
 
setDRot(dx, dy, dz, local)
Sets the angular displacement vector applied by the actuator.
source code
list [vx, vy, vz, local]
getLinearVelocity()
Returns the linear velocity applied by the actuator.
source code
 
setLinearVelocity(vx, vy, vz, local)
Sets the linear velocity applied by the actuator.
source code
list [ωx, ωy, ωz, local]
getAngularVelocity()
Returns the angular velocity applied by the actuator.
source code
 
setAngularVelocity(wx, wy, wz, local)
Sets the angular velocity applied by the actuator.
source code
integer
getDamping()
Returns the damping parameter of the servo controller.
source code
 
setDamping(damp)
Sets the damping parameter of the servo controller.
source code
list [min, max, enabled]
getForceLimitX()
Returns the min/max force limit along the X axis used by the servo controller.
source code
 
setForceLimitX(min, max, enable)
Sets the min/max force limit along the X axis and activates or deactivates the limits in the servo controller.
source code
list [min, max, enabled]
getForceLimitY()
Returns the min/max force limit along the Y axis used by the servo controller.
source code
 
setForceLimitY(min, max, enable)
Sets the min/max force limit along the Y axis and activates or deactivates the limits in the servo controller.
source code
list [min, max, enabled]
getForceLimitZ()
Returns the min/max force limit along the Z axis used by the servo controller.
source code
 
setForceLimitZ(min, max, enable)
Sets the min/max force limit along the Z axis and activates or deactivates the limits in the servo controller.
source code
list [P, I, D]
getPID()
Returns the PID coefficient of the servo controller.
source code
 
setPID(P, I, D)
Sets the PID coefficients of the servo controller.
source code

Inherited from SCA_ILogicBrick.SCA_ILogicBrick: getExecutePriority, getOwner, setExecutePriority

Method Details [hide private]

getForce()

source code 

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)

source code 

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()

source code 

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)

source code 

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()

source code 

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)

source code 

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()

source code 

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)

source code 

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()

source code 

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)

source code 

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()

source code 

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)

source code 

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()

source code 

Returns the damping parameter of the servo controller.

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

setDamping(damp)

source code 

Sets the damping parameter of the servo controller.

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

getForceLimitX()

source code 

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)

source code 

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()

source code 

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)

source code 

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()

source code 

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)

source code 

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()

source code 

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)

source code 

Sets the PID coefficients of the servo controller.

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