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

Source Code for Module KX_TouchSensor

 1  # $Id: KX_TouchSensor.py 15444 2008-07-05 17:05:05Z lukep $ 
 2  # Documentation for KX_TouchSensor 
 3  from SCA_ISensor import * 
 4   
5 -class KX_TouchSensor(SCA_ISensor):
6 """ 7 Touch sensor detects collisions between objects. 8 """
9 - def setProperty(name):
10 """ 11 Set the property or material to collide with. Use 12 setTouchMaterial() to switch between properties and 13 materials. 14 @type name: string 15 """
16 - def getProperty():
17 """ 18 Returns the property or material to collide with. Use 19 getTouchMaterial() to find out whether this sensor 20 looks for properties or materials. 21 22 @rtype: string 23 """
24
25 - def getHitObject():
26 """ 27 Returns the last object hit by this touch sensor. 28 29 @rtype: L{KX_GameObject} 30 """
31 - def getHitObjectList():
32 """ 33 Returns a list of all objects hit in the last frame. 34 35 Only objects that have the requisite material/property are listed. 36 37 @rtype: list [L{KX_GameObject}] 38 """
39 - def getTouchMaterial():
40 """ 41 Returns KX_TRUE if this sensor looks for a specific material, 42 KX_FALSE if it looks for a specific property. 43 """
44 - def setTouchMaterial(flag):
45 """ 46 Set flag to KX_TRUE to switch on positive pulse mode, 47 KX_FALSE to switch off positive pulse mode. 48 49 @type flag: KX_TRUE or KX_FALSE. 50 """
51