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

Class KX_ObjectActuator

source code

PyObjectPlus --+            
               |            
          CValue --+        
                   |        
     SCA_ILogicBrick --+    
                       |    
           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]
    Deprecated
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
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]
list [x, y, z] angV
The angular velocity applied by the actuator
list [x, y, z] dLoc
The displacement vector applied by the actuator
list [x, y, z] dRot
The angular displacement vector applied by the actuator
short damping
The damping parameter of the servo controller
list [x, y, z] force
The force applied by the actuator
list [min(float), max(float), bool] forceLimitX
The min/max force limit along the X axis and activates or deactivates the limits in the servo controller
list [min(float), max(float), bool] forceLimitY
The min/max force limit along the Y axis and activates or deactivates the limits in the servo controller
list [min(float), max(float), bool] forceLimitZ
The min/max force limit along the Z axis and activates or deactivates the limits in the servo controller
list [x, y, z] linV
The linear velocity applied by the actuator
list of floats [proportional, integral, derivate] pid
The PID coefficients of the servo controller
KX_GameObject or None reference
The object that is used as reference to compute the velocity for the servo controller.
list [x, y, z] torque
The torque applied by the actuator
bool useLocalAngV
A flag specifying if the angular velocity is local
bool useLocalDLoc
A flag specifying if the dLoc is local
bool useLocalDRot
A flag specifying if the dRot is local
bool useLocalForce
A flag specifying if the force is local
bool useLocalLinV
A flag specifying if the linear velocity is local
bool useLocalTorque
A flag specifying if the torque is local
    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]

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.

Deprecated: Use force and useLocalForce instead.

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.

Deprecated: Use force and useLocalForce instead.

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)

Deprecated: Use torque and useLocalTorque instead.

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.

Deprecated: Use torque and useLocalTorque instead.

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)

Deprecated: Use dLoc and useLocalDLoc instead.

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.

Deprecated: Use dLoc and useLocalDLoc instead.

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)

Deprecated: Use dRot and useLocalDRot instead.

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.

Deprecated: Use dRot and useLocalDRot instead.

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)

Deprecated: Use linV and useLocalLinV instead.

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.

Deprecated: Use linV and useLocalLinV instead.

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)

Deprecated: Use angV and useLocalAngV instead.

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.

Deprecated: Use angV and useLocalAngV instead.

getDamping()

source code 
Returns the damping parameter of the servo controller.
Returns: integer
the time constant of the servo controller in frame unit.

Deprecated: Use damping instead.

setDamping(damp)

source code 
Sets the damping parameter of the servo controller.
Parameters:
  • damp (integer) - the damping parameter in frame unit.

Deprecated: Use damping instead.

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)

Deprecated: Use forceLimitX instead.

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

Deprecated: Use forceLimitX instead.

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)

Deprecated: Use forceLimitY instead.

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

Deprecated: Use forceLimitY instead.

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)

Deprecated: Use forceLimitZ instead.

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

Deprecated: Use forceLimitZ instead.

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

Deprecated: Use pid instead.

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

Deprecated: Use pid instead.


Instance Variable Details [hide private]

dRot

The angular displacement vector applied by the actuator
  • note: 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.
Type:
list [x, y, z]

useLocalLinV

A flag specifying if the linear velocity is local
  • note: This is the target speed for servo controllers
Type:
bool