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

Class KX_ObjectActuator

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
bool
isA(game_type)
Check if this is a type or a subtype game_type. (Inherited from GameTypes.PyObjectPlus)
    Deprecated
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 GameTypes.SCA_ILogicBrick)
string
getName()
Returns the name of the CValue. (Inherited from GameTypes.CValue)
KX_GameObject
getOwner()
Gets the game object associated with this logic brick. (Inherited from GameTypes.SCA_ILogicBrick)
 
setExecutePriority(priority)
Sets the priority of this logic brick. (Inherited from GameTypes.SCA_ILogicBrick)
Instance Variables
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
int executePriority
This determines the order controllers are evaluated, and actuators are activated (lower priority is executed first). (Inherited from GameTypes.SCA_ILogicBrick)
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
bool invalid
Test if the object has been freed by the game engine and is no longer valid. (Inherited from GameTypes.PyObjectPlus)
list [x, y, z] linV
The linear velocity applied by the actuator
string name
The name of this CValue derived object (read-only). (Inherited from GameTypes.SCA_ILogicBrick)
KX_GameObject or None in exceptional cases. owner
The game object this logic brick is attached to (read-only). (Inherited from GameTypes.SCA_ILogicBrick)
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
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.

Deprecated: Use force and useLocalForce instead.

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.

Deprecated: Use force and useLocalForce instead.

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)

Deprecated: Use torque and useLocalTorque instead.

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.

Deprecated: Use torque and useLocalTorque instead.

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)

Deprecated: Use dLoc and useLocalDLoc instead.

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.

Deprecated: Use dLoc and useLocalDLoc instead.

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)

Deprecated: Use dRot and useLocalDRot instead.

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.

Deprecated: Use dRot and useLocalDRot instead.

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)

Deprecated: Use linV and useLocalLinV instead.

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.

Deprecated: Use linV and useLocalLinV instead.

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)

Deprecated: Use angV and useLocalAngV instead.

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.

Deprecated: Use angV and useLocalAngV instead.

getDamping()

 

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)

 

Sets the damping parameter of the servo controller.

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

Deprecated: Use damping instead.

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)

Deprecated: Use forceLimitX instead.

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

Deprecated: Use forceLimitX instead.

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)

Deprecated: Use forceLimitY instead.

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

Deprecated: Use forceLimitY instead.

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)

Deprecated: Use forceLimitZ instead.

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

Deprecated: Use forceLimitZ instead.

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

Deprecated: Use pid instead.

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

Deprecated: Use pid instead.


Instance Variable Details

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