Package populusgui :: Module PopulusGui :: Class Picker
[frames] | no frames]

Class Picker


This class implements a viewport-to-scene picking tool. The main idea is to pick a scene object just pointing at its 2D viewport projection. Through ray-casting from the 2D point in the viewport. Usually the point is the position of the mouse pointer but the class should allowed also for different pointing interfaces.

In the current implementation, ray-casting is performed by PhysX.

Instance Methods
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
getPickedPoint(self)
Get the position of the picked object.
 
getPickedShape(self)
Get the shape of the picked object.
 
getPickedActor(self)
Get the actor of the picked object.
 
getPickedObject(self)
Get the picked object.
 
getLastTouchedPoint(self)
Get the last touched point.
 
getLastTouchedShape(self)
Get the shape of the last touched object.
 
getLastTouchedActor(self)
Get the actor of the last touched object.
 
getLastTouchedObject(self)
Get the last touched object.
 
pickFromMousePosition(self)
Pick whatever is pointed by the mouse pointer.
 
trackAndPickMousePosition(self, timeToPick=0.5, pickingCallback=None, movingCallback=None)
Start tracking the mouse position and pick when the pointer remain longer than timeToPick time in the same position.
 
enable(self)
Enable the Picker.
 
disable(self)
Disable the Picker.

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties

Inherited from object: __class__

Method Details

__init__(self)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

pickFromMousePosition(self)

 

Pick whatever is pointed by the mouse pointer. The result must be retrieved using the getPicked* interfaces.

trackAndPickMousePosition(self, timeToPick=0.5, pickingCallback=None, movingCallback=None)

 

Start tracking the mouse position and pick when the pointer remain longer than timeToPick time in the same position. Specify a callback if you want to catch picking and mouse moving events.