Module KX_SCA_AddObjectActuator
[hide private]
[frames] | no frames]

Source Code for Module KX_SCA_AddObjectActuator

 1  # $Id: KX_SCA_AddObjectActuator.py 16265 2008-08-27 03:34:53Z campbellbarton $ 
 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(object):
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 object can either be a L{KX_GameObject} or the name of an object or None. 25 26 @type object: L{KX_GameObject}, string or None 27 """
28 - def getObject(name_only = 0):
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 @type name_only: bool 34 @param name_only: optional argument, when 0 return a KX_GameObject 35 @rtype: string, KX_GameObject or None if no object is set 36 """
37 - def setTime(time):
38 """ 39 Sets the lifetime of added objects, in frames. 40 41 If time == 0, the object will last forever. 42 43 @type time: integer 44 @param time: The minimum value for time is 0. 45 """
46 - def getTime():
47 """ 48 Returns the lifetime of the added object, in frames. 49 50 @rtype: integer 51 """
52 - def setLinearVelocity(vx, vy, vz):
53 """ 54 Sets the initial linear velocity of added objects. 55 56 @type vx: float 57 @param vx: the x component of the initial linear velocity. 58 @type vy: float 59 @param vy: the y component of the initial linear velocity. 60 @type vz: float 61 @param vz: the z component of the initial linear velocity. 62 """
63 - def getLinearVelocity():
64 """ 65 Returns the initial linear velocity of added objects. 66 67 @rtype: list [vx, vy, vz] 68 """
69 - def setAngularVelocity(vx, vy, vz):
70 """ 71 Sets the initial angular velocity of added objects. 72 73 @type vx: float 74 @param vx: the x component of the initial angular velocity. 75 @type vy: float 76 @param vy: the y component of the initial angular velocity. 77 @type vz: float 78 @param vz: the z component of the initial angular velocity. 79 """
81 """ 82 Returns the initial angular velocity of added objects. 83 84 @rtype: list [vx, vy, vz] 85 """
87 """ 88 Returns the last object created by this actuator. 89 90 @rtype: L{KX_GameObject} 91 @return: A L{KX_GameObject} or None if no object has been created. 92 """
93