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

Module S2A

source code

The Sensor-To-Actuator library

This module provides functions to transfer parameters from sensors to actuators, sets position or aligns to a vector


Version: 1.1

Author: Monster

Functions [hide private]
 
__getParam(obj, propName, default=None)
Retrieves the property from the object.
source code
 
__getValueOf(cont, attribute)
Finds one sensor with hitObject.
source code
 
__getValueOfPositive(cont, attribute)
Finds one positive sensor with hitObject.
source code
 
__setValueTo(cont, attribute, value)
Configure and activate all actuators.
source code
 
closestHitObjectToObject(cont)
Takes the hitObjectList parameter of the sensor and puts the closest object from that list to the object parameter of the actuator.
source code
 
firstBodyToValue(cont)
Puts the values of the first body of the sensor to the actuators variables value
source code
 
hitNormalToAlign(cont)
Takes the hitNormal parameter of the sensor and aligns the orientation of the actuator owners accordingly.
source code
 
hitObjectToObject(cont)
Takes the hitObject parameter of the sensor and puts it to the object parameter of the actuator.
source code
 
hitPositionToPosition(cont)
Takes the hitPosition parameter of the sensor and sets the position of the actuator owners accordingly.
source code
 
rayDirectionToAlign(cont)
Takes the rayDirection parameter of the sensor and aligns the orientation of the actuator owners accordingly.
source code
 
raySourceToPosition(cont)
Takes the raySource parameter of the sensor and sets the position of the actuator owners accordingly.
source code
 
rayTargetToPosition(cont)
Takes the rayTarget parameter of the sensor and sets the position of the actuator owners accordingly.
source code
Variables [hide private]
  __package__ = 'S2A'
Function Details [hide private]

__getParam(obj, propName, default=None)

source code 

Retrieves the property from the object. If not present returns default.

__getValueOf(cont, attribute)

source code 

Finds one sensor with hitObject.

Parameters:
  • cont - the calling controller
  • attribute - the sensors attribute to be read
Returns:
the value of the sensors attribute

__getValueOfPositive(cont, attribute)

source code 

Finds one positive sensor with hitObject.

Parameters:
  • cont - the calling controller
  • attribute - the sensors attribute to be read
Returns:
the value of the sensors attribute

closestHitObjectToObject(cont)

source code 

Takes the hitObjectList parameter of the sensor and puts the closest object from that list to the object parameter of the actuator.

Supported sensor types:

  • Near
  • Touch
  • Radar

Supported actuator types:

  • TrackTo
  • Camera
  • Parent

The actuators will be activated if one sensor is positive.

Parameters:
  • cont - controller running this function

firstBodyToValue(cont)

source code 

Puts the values of the first body of the sensor to the actuators variables value

Supported sensor types:

  • NetworkMessage

Supported actuator types:

  • Property

The actuators will be activated.

Parameters:
  • cont - controller running this function

hitNormalToAlign(cont)

source code 

Takes the hitNormal parameter of the sensor and aligns the orientation of the actuator owners accordingly.

Supported sensor types:

  • Mouse over
  • Mouse over any
  • Ray

Supported actuator types:

  • any

The actuators will not be activated or changed.

Parameters:
  • axis (integer) - (optional) the axis you want to align
    • 0 = X axis
    • 1 = Y axis
    • 2 = Z axis (default)
  • factor (float) - (optional) only rotate a feaction of the distance to the target vector (0.0 - 1.0)
  • cont - controller running this function

hitObjectToObject(cont)

source code 

Takes the hitObject parameter of the sensor and puts it to the object parameter of the actuator.

Supported sensor types:

  • MouseFocus
  • Near
  • Touch
  • Radar
  • Ray

Supported actuator types:

  • Camera
  • Parent
  • TrackTo

The actuators will be activated.

Parameters:
  • cont - controller running this function

hitPositionToPosition(cont)

source code 

Takes the hitPosition parameter of the sensor and sets the position of the actuator owners accordingly.

Supported sensor types:

  • MouseFocus
  • Ray

Supported actuator types:

  • any

The actuators will not be activated or changed.

Parameters:
  • cont - controller running this function

rayDirectionToAlign(cont)

source code 

Takes the rayDirection parameter of the sensor and aligns the orientation of the actuator owners accordingly.

Supported sensor types:

  • Mouse over
  • Mouse over any
  • Ray

Supported actuator types:

  • any

The actuators will not be activated or changed.

Parameters:
  • axis (integer) - (optional) the axis you want to align
    • 0 = X axis
    • 1 = Y axis
    • 2 = Z axis (default)
  • factor (float) - (optional) only rotate a feaction of the distance to the target vector (0.0 - 1.0)
  • cont - controller running this function

raySourceToPosition(cont)

source code 

Takes the raySource parameter of the sensor and sets the position of the actuator owners accordingly.

Supported sensor types:

  • MouseFocus

Supported actuator types:

  • any

The actuators will not be activated or changed.

Parameters:
  • cont - controller running this function

rayTargetToPosition(cont)

source code 

Takes the rayTarget parameter of the sensor and sets the position of the actuator owners accordingly.

Supported sensor types:

  • MouseFocus

Supported actuator types:

  • any

The actuators will not be activated or changed.

Parameters:
  • cont - controller running this function