|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xith3d.render.Canvas3D
public class Canvas3D
A Canvas3D offers a plane area where the scene is projectively rendered on. A RenderPassConfigProvider is used to define some rendering parameters. This can be the configuration of a RenderPass or a View.
| Field Summary | |
|---|---|
protected int |
oldHeight
|
protected int |
oldWidth
|
| Constructor Summary | |
|---|---|
protected |
Canvas3D(CanvasPeer peer)
|
protected |
Canvas3D(CanvasPeer peer,
org.openmali.vecmath2.Colorf backgroundColor)
|
protected |
Canvas3D(CanvasPeer peer,
float backgroundColorR,
float backgroundColorG,
float backgroundColorB)
|
| Method Summary | |
|---|---|
void |
addRepositionListener(org.openmali.types.twodee.util.RepositionListener2i listener)
Not used! |
void |
addResizeListener(org.openmali.types.twodee.util.ResizeListener2i listener)
Notification occurs in the Xith3D rendering thread and complies with its threading rules. |
void |
addWindowClosingListener(WindowClosingListener l)
Adds a new WindowClosingListener to be notified, when a non-fullscreen Canvas3D's Window is to be closed by clicking the X-button. |
protected void |
checkForResized()
Checks the Canvas3D for resizing. |
void |
clear()
Clears the screen to BLACK. |
void |
disableLighting()
Disables lighting on this Canvas3D. |
void |
enableLighting()
Enables lighting on this Canvas3D. |
protected void |
fireResizeEvent()
Notifies any interested parties that this Canvas3D has been resized. |
float |
getAspect()
|
org.openmali.vecmath2.Colorf |
getBackgroundColor()
|
float |
getBrightness()
|
CanvasPeer |
getCanvasPeer()
Deprecated. Use and see getPeer(). |
float |
getContrast()
|
org.jagatoo.input.render.Cursor |
getCursor()
|
float |
getGamma()
|
int |
getHeight()
|
org.jagatoo.input.devices.InputDeviceFactory |
getInputDeviceFactory()
|
int |
getLeft()
|
org.openmali.vecmath2.Tuple2i |
getLocation()
|
CanvasPeer |
getPeer()
|
Renderer |
getRenderer()
|
RenderOptions |
getRenderOptions()
|
org.openmali.vecmath2.Tuple2i |
getSize()
|
java.lang.String |
getTitle()
|
int |
getTop()
|
View |
getView()
|
org.openmali.types.twodee.Rect2i |
getViewport()
|
int |
getWidth()
|
boolean |
isFullscreen()
|
boolean |
isUndecorated()
|
boolean |
isWireframeMode()
|
void |
pickAll(GroupNode group,
org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
AllPickListener pl)
Picks all Nodes in the given Group. |
void |
pickAll(GroupNode group,
org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
AllPickListener pl,
java.lang.Object userObject)
Picks all Nodes in the given Group. |
void |
pickAll(java.util.List<? extends GroupNode> groups,
org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
AllPickListener pl)
Picks all Nodes in the given Groups. |
void |
pickAll(java.util.List<? extends GroupNode> groups,
org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
AllPickListener pl,
java.lang.Object userObject)
Picks all Nodes in the given Groups. |
void |
pickAll(java.util.List<? extends GroupNode> groups,
org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
int width,
int height,
AllPickListener pl,
java.lang.Object userObject)
|
void |
pickNearest(GroupNode group,
org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
NearestPickListener pl)
Picks the all Nodes in the given Group and finds the closest one to the View. |
void |
pickNearest(GroupNode group,
org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
NearestPickListener pl,
java.lang.Object userObject)
Picks the all Nodes in the given Group and finds the closest one to the View. |
void |
pickNearest(java.util.List<? extends GroupNode> groups,
org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
int width,
int height,
NearestPickListener pl,
java.lang.Object userObject)
|
void |
pickNearest(java.util.List<? extends GroupNode> groups,
org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
NearestPickListener pl)
Picks the all Nodes in the given Groups and finds the closest one to the View. |
void |
pickNearest(java.util.List<? extends GroupNode> groups,
org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
NearestPickListener pl,
java.lang.Object userObject)
Picks the all Nodes in the given Groups and finds the closest one to the View. |
void |
removeRepositionListener(org.openmali.types.twodee.util.RepositionListener2i listener)
Not used! |
void |
removeResizeListener(org.openmali.types.twodee.util.ResizeListener2i listener)
|
void |
removeWindowClosingListener(WindowClosingListener l)
Removes a WindowClosingListener. |
void |
setBackgroundColor(org.openmali.vecmath2.Colorf color)
Sets the background color for this Canvas3D (in fact for the CanvasPeer). |
void |
setBackgroundColor(float red,
float green,
float blue)
Sets the background color for this Canvas3D (in fact for the CanvasPeer). |
void |
setCentered()
Adjusts this standalone canvas's location so that it is centered on the screen |
void |
setCursor(org.jagatoo.input.render.Cursor cursor)
Sets the new Cursor for this Mouse. |
boolean |
setFullscreen(boolean fullscreen)
Switches this Canvas3D's fullscreen flag. |
void |
setGamma(float gamma,
float brightness,
float contrast)
Changes the gamma-, brightness- and contrast values for this CanvasPeer. |
void |
setHeight(int height)
|
void |
setIcon(java.net.URL iconResource)
Changes the window icon. |
Canvas3D |
setLocation(int left,
int top)
Sets the location of the Canvas3D |
Canvas3D |
setLocation(org.openmali.vecmath2.Tuple2i loc)
Sets the location of the Canvas3D |
protected void |
setPeer(CanvasPeer peer)
|
protected void |
setRenderer(Renderer renderer)
Sets the Renderer, this Canvas3D is registered to. |
void |
setRenderOptions(RenderOptions ro)
Sets this Canvas3D's RenderOptions |
Canvas3D |
setSize(int width,
int height)
Sets the size of the Canvas3D |
Canvas3D |
setSize(org.openmali.types.twodee.Sized2iRO size)
Sets the size of the Canvas3D |
Canvas3D |
setSize(org.openmali.vecmath2.Tuple2i size)
Sets the size of the Canvas3D |
void |
setTitle(java.lang.String title)
Sets the containing window's title |
void |
setView(View view)
Assotiates a View with this Canvas3D. |
void |
setViewport(org.openmali.types.twodee.Rect2i viewport)
Sets this CanvasPeer's Viewport. |
void |
setWidth(int width)
|
void |
setWireframeMode(boolean enabled)
Enables or disables wireframe mode. |
boolean |
switchWireframeMode()
Switches wireframe mode. |
java.io.File |
takeScreenshot(boolean alpha)
Takes a screenshot of the current rendering of the first added Canvas3D. |
void |
takeScreenshot(java.io.File file,
boolean alpha)
Takes a screenshot of the current rendering |
java.io.File |
takeScreenshot(java.lang.String filenameBase,
boolean alpha)
Takes a screenshot of the current rendering |
void |
worldToScreen(org.openmali.vecmath2.Tuple3f world,
org.openmali.vecmath2.Tuple2i screen)
Calculates screen coordinates for the given world coordinates. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int oldWidth
protected int oldHeight
| Constructor Detail |
|---|
protected Canvas3D(CanvasPeer peer,
float backgroundColorR,
float backgroundColorG,
float backgroundColorB)
protected Canvas3D(CanvasPeer peer,
org.openmali.vecmath2.Colorf backgroundColor)
protected Canvas3D(CanvasPeer peer)
| Method Detail |
|---|
protected final void setRenderer(Renderer renderer)
renderer - public final Renderer getRenderer()
public void addRepositionListener(org.openmali.types.twodee.util.RepositionListener2i listener)
addRepositionListener in interface org.openmali.types.twodee.ExtPositioned2ipublic void removeRepositionListener(org.openmali.types.twodee.util.RepositionListener2i listener)
removeRepositionListener in interface org.openmali.types.twodee.ExtPositioned2ipublic void addResizeListener(org.openmali.types.twodee.util.ResizeListener2i listener)
addResizeListener in interface org.openmali.types.twodee.ExtSized2ipublic void removeResizeListener(org.openmali.types.twodee.util.ResizeListener2i listener)
removeResizeListener in interface org.openmali.types.twodee.ExtSized2iprotected void fireResizeEvent()
public void addWindowClosingListener(WindowClosingListener l)
l - public void removeWindowClosingListener(WindowClosingListener l)
l - protected void checkForResized()
public final void setView(View view)
view - public final View getView()
protected final void setPeer(CanvasPeer peer)
public final CanvasPeer getPeer()
@Deprecated public final CanvasPeer getCanvasPeer()
getPeer().
public final java.lang.String getTitle()
public final void setTitle(java.lang.String title)
title - the new title
public final void setIcon(java.net.URL iconResource)
throws java.io.IOException
iconResource - the resource of the image for the new icon
java.io.IOExceptionpublic final void clear()
public final void setCursor(org.jagatoo.input.render.Cursor cursor)
null for an invisible Cursor.
Use Cursor.DEFAULT_CURSOR for the system's default Cursor.
cursor - public final org.jagatoo.input.render.Cursor getCursor()
public final org.jagatoo.input.devices.InputDeviceFactory getInputDeviceFactory()
CanvasPeer.getInputDeviceFactory()public final org.openmali.vecmath2.Tuple2i getLocation()
getLocation in interface org.openmali.types.twodee.Positioned2iRO
public final Canvas3D setLocation(int left,
int top)
setLocation in interface org.openmali.types.twodee.Positioned2ileft - top -
public void setCentered()
public final Canvas3D setLocation(org.openmali.vecmath2.Tuple2i loc)
setLocation in interface org.openmali.types.twodee.Positioned2ipublic final int getLeft()
getLeft in interface org.openmali.types.twodee.Positioned2iROpublic final int getTop()
getTop in interface org.openmali.types.twodee.Positioned2iROpublic final org.openmali.vecmath2.Tuple2i getSize()
public final Canvas3D setSize(int width,
int height)
setSize in interface org.openmali.types.twodee.Sized2iwidth - height -
public final Canvas3D setSize(org.openmali.types.twodee.Sized2iRO size)
setSize in interface org.openmali.types.twodee.Sized2isize -
public final Canvas3D setSize(org.openmali.vecmath2.Tuple2i size)
setSize in interface org.openmali.types.twodee.Sized2isize -
public final void setWidth(int width)
setWidth in interface org.openmali.types.twodee.Sized2ipublic final void setHeight(int height)
setHeight in interface org.openmali.types.twodee.Sized2ipublic final int getWidth()
getWidth in interface org.openmali.types.twodee.Sized2iROpublic final int getHeight()
getHeight in interface org.openmali.types.twodee.Sized2iROpublic final float getAspect()
getAspect in interface org.openmali.types.twodee.Sized2iROpublic final boolean setFullscreen(boolean fullscreen)
fullscreen -
public final boolean isFullscreen()
public final boolean isUndecorated()
public final void setViewport(org.openmali.types.twodee.Rect2i viewport)
viewport - public final org.openmali.types.twodee.Rect2i getViewport()
public final void setBackgroundColor(float red,
float green,
float blue)
red - the red component of the new background colorgreen - the green component of the new background colorblue - the blue component of the new background colorpublic final void setBackgroundColor(org.openmali.vecmath2.Colorf color)
color - the new background colorpublic final org.openmali.vecmath2.Colorf getBackgroundColor()
public void setRenderOptions(RenderOptions ro)
public final RenderOptions getRenderOptions()
public void setWireframeMode(boolean enabled)
enabled - if true, wireframe mode will be enabledpublic boolean isWireframeMode()
public boolean switchWireframeMode()
public void enableLighting()
public void disableLighting()
public void setGamma(float gamma,
float brightness,
float contrast)
gamma - the gamma valuebrightness - the brightness value [-1.0, +1.0]contrast - the contrast value [0, +1.0]public float getGamma()
public float getBrightness()
public float getContrast()
public final void takeScreenshot(java.io.File file,
boolean alpha)
takeScreenshot in interface ScreenshotEnginefile - the file to save the screenshot toalpha - with alpha channel?
public final java.io.File takeScreenshot(java.lang.String filenameBase,
boolean alpha)
takeScreenshot in interface ScreenshotEnginefilenameBase - the filenameBase to save the screenshot to (e.g.
"screens/shot") The current date and ".png" are appended.alpha - with alpha channel?
public final java.io.File takeScreenshot(boolean alpha)
takeScreenshot in interface ScreenshotEnginealpha - with alpha channel?
public final void pickAll(java.util.List<? extends GroupNode> groups,
org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
int width,
int height,
AllPickListener pl,
java.lang.Object userObject)
public final void pickNearest(java.util.List<? extends GroupNode> groups,
org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
int width,
int height,
NearestPickListener pl,
java.lang.Object userObject)
public final void pickAll(java.util.List<? extends GroupNode> groups,
org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
AllPickListener pl,
java.lang.Object userObject)
pickAll in interface PickEnginegroups - the Groups to do the picking onbutton - the mouse button, that was clicked to initiate the pickingx - the mouse-x-position where the picking is to be doney - the mouse-y-position where the picking is to be donepl - the PickListener to be notified of the pick resultsuserObject - the user-object to be passed back to the PickListener
public final void pickAll(java.util.List<? extends GroupNode> groups,
org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
AllPickListener pl)
pickAll in interface PickEnginegroups - the Groups to do the picking onbutton - the mouse button, that was clicked to initiate the pickingx - the mouse-x-position where the picking is to be doney - the mouse-y-position where the picking is to be donepl - the PickListener to be notified of the pick results
public final void pickNearest(java.util.List<? extends GroupNode> groups,
org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
NearestPickListener pl,
java.lang.Object userObject)
pickNearest in interface PickEnginegroups - the Groups to do the picking onbutton - the mouse button, that was clicked to initiate the pickingx - the mouse-x-position where the picking is to be doney - the mouse-y-position where the picking is to be donepl - the PickListener to be notified of the pick resultsuserObject - the user-object to be passed back to the PickListener
public final void pickNearest(java.util.List<? extends GroupNode> groups,
org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
NearestPickListener pl)
pickNearest in interface PickEnginegroups - the Groups to do the picking onbutton - the mouse button, that was clicked to initiate the pickingx - the mouse-x-position where the picking is to be doney - the mouse-y-position where the picking is to be donepl - the PickListener to be notified of the pick results
public final void pickAll(GroupNode group,
org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
AllPickListener pl,
java.lang.Object userObject)
pickAll in interface PickEnginegroup - the Group to do the picking onbutton - the mouse button, that was clicked to initiate the pickingx - the mouse-x-position where the picking is to be doney - the mouse-y-position where the picking is to be donepl - the PickListener to be notified of the pick resultsuserObject - the user-object to be passed back to the PickListener
public final void pickAll(GroupNode group,
org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
AllPickListener pl)
pickAll in interface PickEnginegroup - the Group to do the picking onbutton - the mouse button, that was clicked to initiate the pickingx - the mouse-x-position where the picking is to be doney - the mouse-y-position where the picking is to be donepl - the PickListener to be notified of the pick results
public final void pickNearest(GroupNode group,
org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
NearestPickListener pl,
java.lang.Object userObject)
pickNearest in interface PickEnginegroup - the Group to do the picking onbutton - the mouse button, that was clicked to initiate the pickingx - the mouse-x-position where the picking is to be doney - the mouse-y-position where the picking is to be donepl - the PickListener to be notified of the pick resultsuserObject - the user-object to be passed back to the PickListener
public final void pickNearest(GroupNode group,
org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
NearestPickListener pl)
pickNearest in interface PickEnginegroup - the Group to do the picking onbutton - the mouse button, that was clicked to initiate the pickingx - the mouse-x-position where the picking is to be doney - the mouse-y-position where the picking is to be donepl - the PickListener to be notified of the pick results
public void worldToScreen(org.openmali.vecmath2.Tuple3f world,
org.openmali.vecmath2.Tuple2i screen)
world - screen -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||