2004-06-02 12:43:27 +00:00
|
|
|
# $Id$
|
|
|
|
# Documentation for KX_SCA_AddObjectActuator
|
|
|
|
from SCA_IActuator import *
|
|
|
|
|
|
|
|
class KX_SCA_AddObjectActuator(SCA_IActuator):
|
|
|
|
"""
|
|
|
|
Edit Object Actuator (in Add Object Mode)
|
|
|
|
|
2004-07-17 05:28:23 +00:00
|
|
|
@warning: An Add Object actuator will be ignored if at game start, the linked object doesn't exist
|
2004-06-02 12:43:27 +00:00
|
|
|
(or is empty) or the linked object is in an active layer.
|
|
|
|
|
|
|
|
This will genereate a warning in the console:
|
|
|
|
|
|
|
|
C{ERROR: GameObject I{OBName} has a AddObjectActuator I{ActuatorName} without object (in 'nonactive' layer)}
|
|
|
|
"""
|
2008-08-14 08:58:25 +00:00
|
|
|
def setObject(object):
|
2004-06-02 12:43:27 +00:00
|
|
|
"""
|
2004-07-17 05:28:23 +00:00
|
|
|
Sets the game object to add.
|
2004-06-02 12:43:27 +00:00
|
|
|
|
2004-10-16 11:41:50 +00:00
|
|
|
A copy of the object will be added to the scene when the actuator is activated.
|
2004-06-02 12:43:27 +00:00
|
|
|
|
2004-07-17 05:28:23 +00:00
|
|
|
If the object does not exist, this function is ignored.
|
2004-06-02 12:43:27 +00:00
|
|
|
|
2008-08-14 08:58:25 +00:00
|
|
|
object can either be a L{KX_GameObject} or the name of an object or None.
|
2004-07-17 05:28:23 +00:00
|
|
|
|
2008-08-14 08:58:25 +00:00
|
|
|
@type object: L{KX_GameObject}, string or None
|
2004-06-02 12:43:27 +00:00
|
|
|
"""
|
2008-08-14 08:58:25 +00:00
|
|
|
def getObject(name_only = 0):
|
2004-06-02 12:43:27 +00:00
|
|
|
"""
|
|
|
|
Returns the name of the game object to be added.
|
|
|
|
|
2004-09-19 01:33:08 +00:00
|
|
|
Returns None if no game object has been assigned to be added.
|
2008-08-14 08:58:25 +00:00
|
|
|
@type name_only: bool
|
|
|
|
@param name_only: optional argument, when 0 return a KX_GameObject
|
|
|
|
@rtype: string, KX_GameObject or None if no object is set
|
2004-06-02 12:43:27 +00:00
|
|
|
"""
|
|
|
|
def setTime(time):
|
|
|
|
"""
|
|
|
|
Sets the lifetime of added objects, in frames.
|
|
|
|
|
2004-10-16 11:41:50 +00:00
|
|
|
If time == 0, the object will last forever.
|
|
|
|
|
2004-06-02 12:43:27 +00:00
|
|
|
@type time: integer
|
|
|
|
@param time: The minimum value for time is 0.
|
|
|
|
"""
|
|
|
|
def getTime():
|
|
|
|
"""
|
|
|
|
Returns the lifetime of the added object, in frames.
|
|
|
|
|
|
|
|
@rtype: integer
|
|
|
|
"""
|
|
|
|
def setLinearVelocity(vx, vy, vz):
|
|
|
|
"""
|
|
|
|
Sets the initial linear velocity of added objects.
|
|
|
|
|
|
|
|
@type vx: float
|
|
|
|
@param vx: the x component of the initial linear velocity.
|
|
|
|
@type vy: float
|
|
|
|
@param vy: the y component of the initial linear velocity.
|
|
|
|
@type vz: float
|
|
|
|
@param vz: the z component of the initial linear velocity.
|
|
|
|
"""
|
|
|
|
def getLinearVelocity():
|
|
|
|
"""
|
|
|
|
Returns the initial linear velocity of added objects.
|
|
|
|
|
|
|
|
@rtype: list [vx, vy, vz]
|
|
|
|
"""
|
|
|
|
def getLastCreatedObject():
|
|
|
|
"""
|
|
|
|
Returns the last object created by this actuator.
|
|
|
|
|
|
|
|
@rtype: L{KX_GameObject}
|
|
|
|
@return: A L{KX_GameObject} or None if no object has been created.
|
|
|
|
"""
|