Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/gameengine/PyDoc')
-rw-r--r--source/gameengine/PyDoc/GameLogic.py10
-rw-r--r--source/gameengine/PyDoc/KX_CameraActuator.py10
-rw-r--r--source/gameengine/PyDoc/KX_GameObject.py2
-rw-r--r--source/gameengine/PyDoc/KX_NearSensor.py5
-rw-r--r--source/gameengine/PyDoc/KX_ParentActuator.py3
-rw-r--r--source/gameengine/PyDoc/KX_RadarSensor.py18
-rw-r--r--source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py4
-rw-r--r--source/gameengine/PyDoc/KX_Scene.py15
-rw-r--r--source/gameengine/PyDoc/KX_TouchSensor.py37
-rw-r--r--source/gameengine/PyDoc/KX_TrackToActuator.py2
-rw-r--r--source/gameengine/PyDoc/SCA_DelaySensor.py7
-rw-r--r--source/gameengine/PyDoc/SCA_PythonController.py12
12 files changed, 106 insertions, 19 deletions
diff --git a/source/gameengine/PyDoc/GameLogic.py b/source/gameengine/PyDoc/GameLogic.py
index 9dab7db6081..0524a9df355 100644
--- a/source/gameengine/PyDoc/GameLogic.py
+++ b/source/gameengine/PyDoc/GameLogic.py
@@ -140,6 +140,14 @@ Documentation for the GameLogic Module.
@var KX_SOUNDACT_LOOPEND: See L{KX_SoundActuator}
@var KX_SOUNDACT_LOOPBIDIRECTIONAL: See L{KX_SoundActuator}
@var KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP: See L{KX_SoundActuator}
+
+@group Radar Sensor: KX_RADAR_AXIS_POS_X, KX_RADAR_AXIS_POS_Y, KX_RADAR_AXIS_POS_Z, KX_RADAR_AXIS_NEG_X, KX_RADAR_AXIS_NEG_Y, KX_RADAR_AXIS_NEG_Z
+@var KX_RADAR_AXIS_POS_X: See L{KX_RadarSensor}
+@var KX_RADAR_AXIS_POS_Y: See L{KX_RadarSensor}
+@var KX_RADAR_AXIS_POS_Z: See L{KX_RadarSensor}
+@var KX_RADAR_AXIS_NEG_X: See L{KX_RadarSensor}
+@var KX_RADAR_AXIS_NEG_Y: See L{KX_RadarSensor}
+@var KX_RADAR_AXIS_NEG_Z: See L{KX_RadarSensor}
"""
@@ -159,7 +167,7 @@ def addActiveActuator(actuator, activate):
"""
Activates the given actuator.
- @type actuator: L{SCA_IActuator}
+ @type actuator: L{SCA_IActuator} or the actuator name as a string.
@type activate: boolean
@param activate: whether to activate or deactivate the given actuator.
"""
diff --git a/source/gameengine/PyDoc/KX_CameraActuator.py b/source/gameengine/PyDoc/KX_CameraActuator.py
index 9a9abaf3d57..6ffc55a5854 100644
--- a/source/gameengine/PyDoc/KX_CameraActuator.py
+++ b/source/gameengine/PyDoc/KX_CameraActuator.py
@@ -6,6 +6,16 @@ class KX_CameraActuator(SCA_IActuator):
"""
Applies changes to a camera.
+ @ivar min: minimum distance to the target object maintained by the actuator
+ @type min: float
+ @ivar max: maximum distance to stay from the target object
+ @type max: float
+ @ivar height: height to stay above the target object
+ @type height: float
+ @ivar xy: axis this actuator is tracking, true=X, false=Y
+ @type xy: boolean
+ @ivar object: the object this actuator tracks.
+ @type object: KX_GameObject or None
@author: snail
"""
def getObject(name_only = 1):
diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py
index efeffab2eed..4f389a1ae4f 100644
--- a/source/gameengine/PyDoc/KX_GameObject.py
+++ b/source/gameengine/PyDoc/KX_GameObject.py
@@ -7,7 +7,7 @@ class KX_GameObject:
Properties assigned to game objects are accessible as attributes of this class.
- @ivar name: The object's name.
+ @ivar name: The object's name. (Read only)
@type name: string.
@ivar mass: The object's mass (provided the object has a physics controller). Read only.
@type mass: float
diff --git a/source/gameengine/PyDoc/KX_NearSensor.py b/source/gameengine/PyDoc/KX_NearSensor.py
index fef2e4b2acc..a8c408827fe 100644
--- a/source/gameengine/PyDoc/KX_NearSensor.py
+++ b/source/gameengine/PyDoc/KX_NearSensor.py
@@ -5,5 +5,10 @@ from KX_TouchSensor import *
class KX_NearSensor(KX_TouchSensor):
"""
A near sensor is a specialised form of touch sensor.
+
+ @ivar distance: The near sensor activates when an object is within this distance.
+ @type distance: float
+ @ivar resetDistance: The near sensor deactivates when the object exceeds this distance.
+ @type resetDistance: float
"""
diff --git a/source/gameengine/PyDoc/KX_ParentActuator.py b/source/gameengine/PyDoc/KX_ParentActuator.py
index 6d6e0937257..7b5625ec82d 100644
--- a/source/gameengine/PyDoc/KX_ParentActuator.py
+++ b/source/gameengine/PyDoc/KX_ParentActuator.py
@@ -5,6 +5,9 @@ from SCA_IActuator import *
class KX_ParentActuator(SCA_IActuator):
"""
The parent actuator can set or remove an objects parent object.
+
+ @ivar object: the object this actuator sets the parent too.
+ @type object: KX_GameObject or None
"""
def setObject(object):
"""
diff --git a/source/gameengine/PyDoc/KX_RadarSensor.py b/source/gameengine/PyDoc/KX_RadarSensor.py
index 64be858371a..b68bf4ea0f3 100644
--- a/source/gameengine/PyDoc/KX_RadarSensor.py
+++ b/source/gameengine/PyDoc/KX_RadarSensor.py
@@ -5,8 +5,26 @@ from KX_NearSensor import *
class KX_RadarSensor(KX_NearSensor):
"""
Radar sensor is a near sensor with a conical sensor object.
+
+ @ivar coneOrigin: The origin of the cone with which to test. The origin
+ is in the middle of the cone.
+ (Read only)
+ @type coneOrigin: list of floats [x, y, z]
+ @ivar coneTarget: The center of the bottom face of the cone with which to test.
+ (Read only)
+ @type coneTarget: list of floats [x, y, z]
+ @ivar distance: The height of the cone with which to test.
+ @type distance: float
+ @ivar angle: The angle of the cone (in degrees) with which to test.
+ @type angle: float from 0 to 360
+ @ivar axis: The axis on which the radar cone is cast
+ @type axis: int from 0 to 5
+ KX_RADAR_AXIS_POS_X, KX_RADAR_AXIS_POS_Y, KX_RADAR_AXIS_POS_Z,
+ KX_RADAR_AXIS_NEG_X, KX_RADAR_AXIS_NEG_Y, KX_RADAR_AXIS_NEG_Z
"""
+
+ #--The following methods are deprecated, please use properties instead.
def getConeOrigin():
"""
Returns the origin of the cone with which to test. The origin
diff --git a/source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py b/source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py
index c3b2e947ddb..56068fa641a 100644
--- a/source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py
+++ b/source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py
@@ -5,6 +5,10 @@ from SCA_IActuator import *
class KX_SCA_AddObjectActuator(SCA_IActuator):
"""
Edit Object Actuator (in Add Object Mode)
+ @ivar object: the object this actuator adds.
+ @type object: KX_GameObject or None
+ @ivar objectLastCreated: the last added object from this actuator (read only).
+ @type objectLastCreated: KX_GameObject or None
@warning: An Add Object actuator will be ignored if at game start, the linked object doesn't exist
(or is empty) or the linked object is in an active layer.
diff --git a/source/gameengine/PyDoc/KX_Scene.py b/source/gameengine/PyDoc/KX_Scene.py
index 4a0a7a9556d..5e357e6eefc 100644
--- a/source/gameengine/PyDoc/KX_Scene.py
+++ b/source/gameengine/PyDoc/KX_Scene.py
@@ -39,6 +39,8 @@ class KX_Scene:
@ivar name: The scene's name
@type name: string
+ @type objects: A list of objects in the scene.
+ @type objects: list [L{KX_GameObject}]
@ivar active_camera: The current active camera
@type active_camera: L{KX_Camera}
@ivar suspended: True if the scene is suspended.
@@ -68,3 +70,16 @@ class KX_Scene:
@rtype: string
"""
+ def addObject(object, other, time=0)
+ """
+ Adds an object to the scene like the Add Object Actuator would, and returns the created object.
+
+ @param object: The object to add
+ @type object: L{KX_GameObject} or string
+ @param other: The object's center to use when adding the object
+ @type other: L{KX_GameObject} or string
+ @param time: The lifetime of the added object, in frames. A time of 0 means the object will last forever.
+ @type time: int
+
+ @rtype: L{KX_GameObject}
+ """
diff --git a/source/gameengine/PyDoc/KX_TouchSensor.py b/source/gameengine/PyDoc/KX_TouchSensor.py
index f2cc101af10..d7277be4c2a 100644
--- a/source/gameengine/PyDoc/KX_TouchSensor.py
+++ b/source/gameengine/PyDoc/KX_TouchSensor.py
@@ -1,36 +1,55 @@
# $Id$
# Documentation for KX_TouchSensor
from SCA_ISensor import *
+from KX_GameObject import *
class KX_TouchSensor(SCA_ISensor):
"""
Touch sensor detects collisions between objects.
+
+ @ivar property: The property or material to collide with.
+ @type property: string
+ @ivar useMaterial: Determines if the sensor is looking for a property or material.
+ KX_True = Find material; KX_False = Find property
+ @type useMaterial: boolean
+ @ivar pulseCollisions: The last collided object.
+ @type pulseCollisions: bool
+ @ivar objectHit: The last collided object. (Read Only)
+ @type objectHit: L{KX_GameObject} or None
+ @ivar objectHitList: A list of colliding objects. (Read Only)
+ @type objectHitList: list
"""
+
+ #--The following methods are deprecated, please use properties instead.
def setProperty(name):
"""
+ DEPRECATED: use the property property
Set the property or material to collide with. Use
setTouchMaterial() to switch between properties and
materials.
@type name: string
"""
+
def getProperty():
"""
+ DEPRECATED: use the property property
Returns the property or material to collide with. Use
getTouchMaterial() to find out whether this sensor
- looks for properties or materials.
+ looks for properties or materials. (B{deprecated})
@rtype: string
"""
-
def getHitObject():
"""
- Returns the last object hit by this touch sensor.
+ DEPRECATED: use the objectHit property
+ Returns the last object hit by this touch sensor. (B{deprecated})
@rtype: L{KX_GameObject}
"""
def getHitObjectList():
"""
- Returns a list of all objects hit in the last frame.
+ DEPRECATED: use the objectHitList property
+ Returns a list of all objects hit in the last frame. (B{deprecated})
Only objects that have the requisite material/property are listed.
@@ -38,13 +57,7 @@ class KX_TouchSensor(SCA_ISensor):
"""
def getTouchMaterial():
"""
+ DEPRECATED: use the useMaterial property
Returns KX_TRUE if this sensor looks for a specific material,
- KX_FALSE if it looks for a specific property.
- """
- def setTouchMaterial(flag):
- """
- Set flag to KX_TRUE to switch on positive pulse mode,
- KX_FALSE to switch off positive pulse mode.
-
- @type flag: KX_TRUE or KX_FALSE.
+ KX_FALSE if it looks for a specific property. (B{deprecated})
"""
diff --git a/source/gameengine/PyDoc/KX_TrackToActuator.py b/source/gameengine/PyDoc/KX_TrackToActuator.py
index 948302991b7..730ab21166b 100644
--- a/source/gameengine/PyDoc/KX_TrackToActuator.py
+++ b/source/gameengine/PyDoc/KX_TrackToActuator.py
@@ -13,6 +13,8 @@ class KX_TrackToActuator(SCA_IActuator):
C{ERROR: GameObject I{OBName} no object in EditObjectActuator I{ActuatorName}}
+ @ivar object: the object this actuator tracks.
+ @type object: KX_GameObject or None
"""
def setObject(object):
"""
diff --git a/source/gameengine/PyDoc/SCA_DelaySensor.py b/source/gameengine/PyDoc/SCA_DelaySensor.py
index b99ed08bed5..6560df6573e 100644
--- a/source/gameengine/PyDoc/SCA_DelaySensor.py
+++ b/source/gameengine/PyDoc/SCA_DelaySensor.py
@@ -20,10 +20,9 @@ class SCA_DelaySensor(SCA_ISensor):
@type delay: integer.
@ivar duration: length of the ON period in number of frame after the initial OFF period.
If duration is greater than 0, a negative trigger is sent at the end of the ON pulse.
- @type duration: integer
- @ivar repeat: 1 if the OFF-ON cycle should be repeated indefinately, 0 if it should run once.
- @type repeat: integer
-
+ @type duration: integer
+ @ivar repeat: 1 if the OFF-ON cycle should be repeated indefinately, 0 if it should run once.
+ @type repeat: integer
"""
def setDelay(delay):
"""
diff --git a/source/gameengine/PyDoc/SCA_PythonController.py b/source/gameengine/PyDoc/SCA_PythonController.py
index 06f2b7e9d1d..9684b41d481 100644
--- a/source/gameengine/PyDoc/SCA_PythonController.py
+++ b/source/gameengine/PyDoc/SCA_PythonController.py
@@ -15,7 +15,17 @@ class SCA_PythonController(SCA_IController):
This can be used with the GameObject's state to test if the controller is active.
@type state: integer
"""
-
+ def activate(actuator):
+ """
+ Activates an actuator attached to this controller.
+ @type actuator: actuator or the actuator name as a string
+ """
+ def deactivate(actuator):
+ """
+ Deactivates an actuator attached to this controller.
+ @type actuator: actuator or the actuator name as a string
+ """
+
def getSensors():
"""
Gets a list of all sensors attached to this controller.