|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.threed.jpct.Interact2D
public final class Interact2D
Interact2D offers some static methods for interacting with objects in camera-space. Its main purpose is to allow object-picking with the mouse (or with whatever). Everything within here has to be called after calling World.renderScene(...), because the current visibility list is required.
Method Summary | |
---|---|
static SimpleVector |
project3D2D(Camera camera,
FrameBuffer buffer,
SimpleVector vertex)
Projects a vertex from world space into screen space. |
static SimpleVector |
project3D2D(Camera camera,
FrameBuffer buffer,
SimpleVector vertex,
SimpleVector toFill)
Projects a vertex from world space into screen space. |
static SimpleVector |
projectCenter3D2D(Camera camera,
FrameBuffer buffer,
Object3D obj)
Gets the center of the object in screen-coordinates (2D) by transforming and projecting it from 3D objectspace into 2D screenspace. |
static SimpleVector |
projectCenter3D2D(FrameBuffer buffer,
Object3D obj)
Gets the center of the object in screen-coordinates (2D) by transforming and projecting it from 3D objectspace into 2D screenspace. |
static SimpleVector |
reproject2D3D(Camera camera,
FrameBuffer buffer,
int x,
int y)
Reprojects a 2D vector (a screen/framebuffer coordinate in most cases) back into 3D. |
static SimpleVector |
reproject2D3D(Camera camera,
FrameBuffer buffer,
int x,
int y,
float z)
Reprojects a 2D vector (a screen/framebuffer coordinate in most cases) back into 3D with a given z (in 3D). |
static SimpleVector |
reproject2D3D(Camera camera,
FrameBuffer buffer,
int x,
int y,
float z,
SimpleVector toFill)
Reprojects a 2D vector (a screen/framebuffer coordinate in most cases) back into 3D with a given z (in 3D). |
static SimpleVector |
reproject2D3D(Camera camera,
FrameBuffer buffer,
int x,
int y,
SimpleVector toFill)
Reprojects a 2D vector (a screen/framebuffer coordinate in most cases) back into 3D. |
static SimpleVector |
reproject2D3DWS(Camera camera,
FrameBuffer buffer,
int x,
int y)
Reprojects a 2D vector (a screen/framebuffer coordinate in most cases) back into 3D (world space). |
static SimpleVector |
reproject2D3DWS(Camera camera,
FrameBuffer buffer,
int x,
int y,
SimpleVector toFill)
Reprojects a 2D vector (a screen/framebuffer coordinate in most cases) back into 3D (world space). |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static SimpleVector reproject2D3D(Camera camera, FrameBuffer buffer, int x, int y)
camera
- the camera used to render the scenebuffer
- the framebuffer containing the rendered imagex
- the x position in 2Dy
- the y position in 2D
public static SimpleVector reproject2D3D(Camera camera, FrameBuffer buffer, int x, int y, SimpleVector toFill)
camera
- the camera used to render the scenebuffer
- the framebuffer containing the rendered imagex
- the x position in 2Dy
- the y position in 2DtoFill
- a SimpleVector that will be filled with the result
public static SimpleVector reproject2D3DWS(Camera camera, FrameBuffer buffer, int x, int y)
camera
- the camera used to render the scenebuffer
- the framebuffer containing the rendered imagex
- the x position in 2Dy
- the y position in 2D
public static SimpleVector reproject2D3DWS(Camera camera, FrameBuffer buffer, int x, int y, SimpleVector toFill)
camera
- the camera used to render the scenebuffer
- the framebuffer containing the rendered imagex
- the x position in 2Dy
- the y position in 2DtoFill
- a SimpleVector that will be filled with the result
public static SimpleVector reproject2D3D(Camera camera, FrameBuffer buffer, int x, int y, float z)
camera
- the camera used to render the scenebuffer
- the framebuffer containing the rendered imagex
- the x position in 2Dy
- the y position in 2Dz
- the z position of the "picking plane" (in 3D)
public static SimpleVector reproject2D3D(Camera camera, FrameBuffer buffer, int x, int y, float z, SimpleVector toFill)
camera
- the camera used to render the scenebuffer
- the framebuffer containing the rendered imagex
- the x position in 2Dy
- the y position in 2Dz
- the z position of the "picking plane" (in 3D)toFill
- a SimpleVector that will be filled with the result
public static SimpleVector project3D2D(Camera camera, FrameBuffer buffer, SimpleVector vertex)
camera
- the Camera used for the projectionbuffer
- the Framebuffervertex
- the vertex in world space
public static SimpleVector project3D2D(Camera camera, FrameBuffer buffer, SimpleVector vertex, SimpleVector toFill)
camera
- the Camera used for the projectionbuffer
- the Framebuffervertex
- the vertex in world spacetoFill
- the SimpleVector that will be filled with the result
public static SimpleVector projectCenter3D2D(FrameBuffer buffer, Object3D obj)
buffer
- the framebuffer the object will be (or has been) rendered intoobj
- the object itself
public static SimpleVector projectCenter3D2D(Camera camera, FrameBuffer buffer, Object3D obj)
camera
- the camera that represents the worldspace->cameraspace
transformation. The frontbuffer matrix of the camera will be
used. If the camera is null, the one from the object's World
will be used instead.buffer
- the framebuffer the object will be (or has been) rendered intoobj
- the object itself
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |