Module KX_SCA_AddObjectActuator

Source Code for Module KX_SCA_AddObjectActuator

 1  # $Id: KX_SCA_AddObjectActuator.py 3271 2004-10-16 11:41:50Z kester $ 
 2  # Documentation for KX_SCA_AddObjectActuator 
 3  from SCA_IActuator import * 
 4   
5 -class KX_SCA_AddObjectActuator(SCA_IActuator):
6 """ 7 Edit Object Actuator (in Add Object Mode) 8 9 @warning: An Add Object actuator will be ignored if at game start, the linked object doesn't exist 10 (or is empty) or the linked object is in an active layer. 11 12 This will genereate a warning in the console: 13 14 C{ERROR: GameObject I{OBName} has a AddObjectActuator I{ActuatorName} without object (in 'nonactive' layer)} 15 """
16 - def setObject(obj):
17 """ 18 Sets the game object to add. 19 20 A copy of the object will be added to the scene when the actuator is activated. 21 22 If the object does not exist, this function is ignored. 23 24 obj can either be a L{KX_GameObject} or the name of an object. 25 26 @type obj: L{KX_GameObject} or string 27 """
28 - def getObject():
29 """ 30 Returns the name of the game object to be added. 31 32 Returns None if no game object has been assigned to be added. 33 34 @rtype: string 35 """
36 - def setTime(time):
37 """ 38 Sets the lifetime of added objects, in frames. 39 40 If time == 0, the object will last forever. 41 42 @type time: integer 43 @param time: The minimum value for time is 0. 44 """
45 - def getTime():
46 """ 47 Returns the lifetime of the added object, in frames. 48 49 @rtype: integer 50 """
51 - def setLinearVelocity(vx, vy, vz):
52 """ 53 Sets the initial linear velocity of added objects. 54 55 @type vx: float 56 @param vx: the x component of the initial linear velocity. 57 @type vy: float 58 @param vy: the y component of the initial linear velocity. 59 @type vz: float 60 @param vz: the z component of the initial linear velocity. 61 """
62 - def getLinearVelocity():
63 """ 64 Returns the initial linear velocity of added objects. 65 66 @rtype: list [vx, vy, vz] 67 """
69 """ 70 Returns the last object created by this actuator. 71 72 @rtype: L{KX_GameObject} 73 @return: A L{KX_GameObject} or None if no object has been created. 74 """
75