Packageaway3d.graphs.bsp
Classpublic final class BSPHitTest

Ray to BSP geometry hittest Ideal to build FPS game, where weapons need to check a hit, in order to animate a missile etc...

Public Properties
 PropertyDefined by
  lastHittedMeshName : String
[read-only] if a dynamic mesh was added to tree with a name, on hit test you might want retrieve its name and compare with your saved names list.
BSPHitTest
Public Methods
 MethodDefined by
  
BSPHitTest
(bspTree:BSPTree)
Creates a new BSPHittest object.
BSPHitTest
  
Finds the closest intersection along a segment with the BSP planes
BSPHitTest
  
Finds the uv's and the map of the face found at the closest intersection, the closest intersection along a segment with the BSP planes
BSPHitTest
Property detail
lastHittedMeshNameproperty
lastHittedMeshName:String  [read-only]

if a dynamic mesh was added to tree with a name, on hit test you might want retrieve its name and compare with your saved names list. Works only after getUVIntersectPosition method has been used.

Implementation
    public function get lastHittedMeshName():String
Constructor detail
BSPHitTest()constructor
public function BSPHitTest(bspTree:BSPTree)Parameters
bspTree:BSPTree — BSPTree instance
Init Parameters
Method detail
getIntersectPosition()method
public function getIntersectPosition(start:Number3D, end:Number3D):Number3D

Finds the closest intersection along a segment with the BSP planes

Parameters
start:Number3D — The starting position (camera position for instance)
 
end:Number3D — The position (the camera position for instance)

Returns
Number3D — A Number3D of the intersection. Null if no hit.
getUVIntersectPosition()method 
public function getUVIntersectPosition(start:Number3D, end:Number3D):Array

Finds the uv's and the map of the face found at the closest intersection, the closest intersection along a segment with the BSP planes

Parameters
start:Number3D — The starting position (camera position for instance)
 
end:Number3D — The position (the camera position for instance)

Returns
Array — An Array or null array = [intersection, uv, bitmapdata] [Number3D, the intersection in space, UV of the intersection. Null if no hit or nodeleaf is empty, the bitmapData assigned to the face. Null if there's not]
Wiki link
Click to go to the wiki page for 'away3d.graphs.bsp.BSPHitTest'

Code examples

Comments