Packageaway3d.core.pick
Classpublic class RaycastPicker
InheritanceRaycastPicker Inheritance Object
Implements IPicker

Picks a 3d object from a view or scene by 3D raycast calculations. Performs an initial coarse boundary calculation to return a subset of entities whose bounding volumes intersect with the specified ray, then triggers an optional picking collider on individual entity objects to further determine the precise values of the picking ray collision.



Protected Properties
 PropertyDefined By
  _entities : Vector.<Entity>
RaycastPicker
  _hasCollisions : Boolean
RaycastPicker
  _numEntities : uint
RaycastPicker
Public Methods
 MethodDefined By
  
RaycastPicker(findClosestCollision:Boolean)
Creates a new RaycastPicker object.
RaycastPicker
  
getSceneCollision(position:Vector3D, direction:Vector3D, scene:Scene3D):PickingCollisionVO
Gets the collision object from the scene position and direction of the picking ray.
RaycastPicker
  
getViewCollision(x:Number, y:Number, view:View3D):PickingCollisionVO
Gets the collision object from the screen coordinates of the picking ray.
RaycastPicker
Property Detail
_entitiesproperty
protected var _entities:Vector.<Entity>

_hasCollisionsproperty 
protected var _hasCollisions:Boolean

_numEntitiesproperty 
protected var _numEntities:uint

Constructor Detail
RaycastPicker()Constructor
public function RaycastPicker(findClosestCollision:Boolean)

Creates a new RaycastPicker object.

Parameters
findClosestCollision:Boolean — Determines whether the picker searches for the closest bounds collision along the ray, or simply returns the first collision encountered Defaults to false.
Method Detail
getSceneCollision()method
public function getSceneCollision(position:Vector3D, direction:Vector3D, scene:Scene3D):PickingCollisionVO

Gets the collision object from the scene position and direction of the picking ray.

Parameters

position:Vector3D — The position of the picking ray in scene-space.
 
direction:Vector3D — The direction of the picking ray in scene-space.
 
scene:Scene3D — The scene on which the picking object acts.

Returns
PickingCollisionVO
getViewCollision()method 
public function getViewCollision(x:Number, y:Number, view:View3D):PickingCollisionVO

Gets the collision object from the screen coordinates of the picking ray.

Parameters

x:Number — The x coordinate of the picking ray in screen-space.
 
y:Number — The y coordinate of the picking ray in screen-space.
 
view:View3D — The view on which the picking object acts.

Returns
PickingCollisionVO