org.xith3d.picking
Class PickRay

java.lang.Object
  extended by org.openmali.vecmath2.Ray3f
      extended by org.xith3d.picking.PickRay
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public class PickRay
extends org.openmali.vecmath2.Ray3f

Implements a pick-ray.

See Also:
Serialized Form

Constructor Summary
PickRay()
          Creates a pick-ray
PickRay(RenderPassConfig rpc, Canvas3D canvas, int canvasX, int canvasY)
          Creates a pick-ray
PickRay(View.CameraMode cameraMode, Canvas3D canvas, int canvasX, int canvasY)
          Creates a pick-ray
PickRay(View.ProjectionPolicy projectionPolicy, float fieldOfView, float screenScale, float centerViewX, float centerViewY, org.openmali.vecmath2.Matrix4f viewMatrix, float canvasWidth, float canvasHeight, float canvasX, float canvasY)
          Creates a pick-ray
PickRay(View view, View.CameraMode cameraMode, Canvas3D canvas, int canvasX, int canvasY)
          Creates a pick-ray
 
Method Summary
 void recalculate(Canvas3D canvas, int canvasX, int canvasY)
          Creates a pick-ray
 void recalculate(float canvasX, float canvasY)
          Recalculates the PickRay.
 void recalculate(int canvasX, int canvasY)
          Creates a pick-ray
 void recalculate(org.openmali.vecmath2.Matrix4f viewMatrix)
          Recalculates the PickRay.
 void recalculate(PickRay template, View.CameraMode cameraMode)
           
 void recalculate(RenderPassConfig rpc, Canvas3D canvas, int canvasX, int canvasY)
          Creates a pick-ray
 void recalculate(View.CameraMode cameraMode, Canvas3D canvas, int canvasX, int canvasY)
          Creates a pick-ray
 void recalculate(View.ProjectionPolicy projectionPolicy, float fieldOfView, float screenScale, float centerViewX, float centerViewY, org.openmali.vecmath2.Matrix4f viewMatrix, float canvasWidth, float canvasHeight, float canvasX, float canvasY)
          Creates a pick-ray
 
Methods inherited from class org.openmali.vecmath2.Ray3f
clone, deserialize, equals, equals, fromPool, fromPool, fromPool, fromPool, getDirection, getLength, getLengthSquared, getOrigin, getSerializationBufferSize, isDirty, isReadOnly, length, lengthSquared, newReadOnly, newReadOnly, newReadOnly, newReadOnly, readExternal, serialize, set, set, set, setClean, setDirection, setDirection, setOrigin, setOrigin, setZero, toPool, toString, writeExternal
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PickRay

public PickRay()
Creates a pick-ray


PickRay

public PickRay(View.ProjectionPolicy projectionPolicy,
               float fieldOfView,
               float screenScale,
               float centerViewX,
               float centerViewY,
               org.openmali.vecmath2.Matrix4f viewMatrix,
               float canvasWidth,
               float canvasHeight,
               float canvasX,
               float canvasY)
Creates a pick-ray

Parameters:
projectionPolicy - the View's projection policy
fieldOfView - the View's field of view
screenScale - the View's screen scale
centerViewX - the x-coordinate of center-of-view
centerViewY - the x-coordinate of center-of-view
viewMatrix - the View's transform matrix
canvasWidth - the Canvas3D's width
canvasHeight - the Canvas3D's height
canvasX - the x position on the Canvas3D
canvasY - the y position on the Canvas3D

PickRay

public PickRay(View view,
               View.CameraMode cameraMode,
               Canvas3D canvas,
               int canvasX,
               int canvasY)
Creates a pick-ray

Parameters:
view - the View to take for calculation
cameraMode -
canvas - the Canvas3D to take for calculation
canvasX - the x position on the Canvas3D
canvasY - the y position on the Canvas3D

PickRay

public PickRay(View.CameraMode cameraMode,
               Canvas3D canvas,
               int canvasX,
               int canvasY)
Creates a pick-ray

Parameters:
cameraMode -
canvas - the Canvas3D to take for calculation (and the Canvas3D's View)
canvasX - the x position on the Canvas3D
canvasY - the y position on the Canvas3D

PickRay

public PickRay(RenderPassConfig rpc,
               Canvas3D canvas,
               int canvasX,
               int canvasY)
Creates a pick-ray

Parameters:
rpc - the RenderPassConfig to take calculation values from
canvas - the Canvas3D to take for calculation (and the Canvas3D's View)
canvasX - the x position on the Canvas3D
canvasY - the y position on the Canvas3D
Method Detail

recalculate

public void recalculate(float canvasX,
                        float canvasY)
Recalculates the PickRay.

Parameters:
canvasX - the x position on the Canvas3D
canvasY - the y position on the Canvas3D

recalculate

public void recalculate(org.openmali.vecmath2.Matrix4f viewMatrix)
Recalculates the PickRay.

Parameters:
viewMatrix - teh model-view-matrix

recalculate

public void recalculate(View.ProjectionPolicy projectionPolicy,
                        float fieldOfView,
                        float screenScale,
                        float centerViewX,
                        float centerViewY,
                        org.openmali.vecmath2.Matrix4f viewMatrix,
                        float canvasWidth,
                        float canvasHeight,
                        float canvasX,
                        float canvasY)
Creates a pick-ray

Parameters:
projectionPolicy - the View's projection policy
fieldOfView - the View's field of view
screenScale - the View's screen scale
centerViewX - the x-coordinate of center-of-view
centerViewY - the x-coordinate of center-of-view
viewMatrix - the View's transform matrix
canvasWidth - the Canvas3D's width
canvasHeight - the Canvas3D's height
canvasX - the x position on the Canvas3D
canvasY - the y position on the Canvas3D

recalculate

public void recalculate(PickRay template,
                        View.CameraMode cameraMode)

recalculate

public void recalculate(Canvas3D canvas,
                        int canvasX,
                        int canvasY)
Creates a pick-ray

Parameters:
canvas - the Canvas3D to take for calculation
canvasX - the x position on the Canvas3D
canvasY - the y position on the Canvas3D

recalculate

public void recalculate(int canvasX,
                        int canvasY)
Creates a pick-ray

Parameters:
canvas - the Canvas3D to take for calculation
canvasX - the x position on the Canvas3D
canvasY - the y position on the Canvas3D

recalculate

public void recalculate(RenderPassConfig rpc,
                        Canvas3D canvas,
                        int canvasX,
                        int canvasY)
Creates a pick-ray

Parameters:
rpc - the RenderPassConfig to take calculation values from
canvas - the Canvas3D to take for calculation
canvasX - the x position on the Canvas3D
canvasY - the y position on the Canvas3D

recalculate

public void recalculate(View.CameraMode cameraMode,
                        Canvas3D canvas,
                        int canvasX,
                        int canvasY)
Creates a pick-ray

Parameters:
canvas - the Canvas3D to take for calculation (and the Canvas3D's View)
canvasX - the x position on the Canvas3D
canvasY - the y position on the Canvas3D