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

Class KX_TouchSensor

source code

SCA_ILogicBrick.SCA_ILogicBrick --+    
                                  |    
            SCA_ISensor.SCA_ISensor --+
                                      |
                                     KX_TouchSensor
Known Subclasses:

Touch sensor detects collisions between objects.

Instance Methods [hide private]
 
setProperty(name)
Set the property or material to collide with.
source code
string
getProperty()
Returns the property or material to collide with.
source code
KX_GameObject
getHitObject()
Returns the last object hit by this touch sensor.
source code
list [KX_GameObject]
getHitObjectList()
Returns a list of all objects hit in the last frame.
source code
 
getTouchMaterial()
Returns KX_TRUE if this sensor looks for a specific material, KX_FALSE if it looks for a specific property.
source code
 
setTouchMaterial(flag)
Set flag to KX_TRUE to switch on positive pulse mode, KX_FALSE to switch off positive pulse mode.
source code

Inherited from SCA_ISensor.SCA_ISensor: getFrequency, getInvert, getLevel, getUseNegPulseMode, getUsePosPulseMode, isPositive, isTriggered, reset, setFrequency, setInvert, setLevel, setUseNegPulseMode, setUsePosPulseMode

Inherited from SCA_ILogicBrick.SCA_ILogicBrick: getExecutePriority, getOwner, setExecutePriority

Method Details [hide private]

setProperty(name)

source code 

Set the property or material to collide with. Use setTouchMaterial() to switch between properties and materials.

Parameters:
  • name (string)

getProperty()

source code 

Returns the property or material to collide with. Use getTouchMaterial() to find out whether this sensor looks for properties or materials.

Returns: string

getHitObjectList()

source code 

Returns a list of all objects hit in the last frame.

Only objects that have the requisite material/property are listed.

Returns: list [KX_GameObject]

setTouchMaterial(flag)

source code 

Set flag to KX_TRUE to switch on positive pulse mode, KX_FALSE to switch off positive pulse mode.

Parameters:
  • flag (KX_TRUE or KX_FALSE.)