com.jme3.renderer
クラス ViewPort

java.lang.Object
  上位を拡張 com.jme3.renderer.ViewPort

public class ViewPort
extends java.lang.Object

A ViewPort represents a view inside the display window or a FrameBuffer to which scenes will be rendered.

A viewport has a camera which is used to render a set of scenes. A view port has a location on the screen as set by the Camera.setViewPort(float, float, float, float) method. By default, a view port does not clear the framebuffer, but it can be set to clear the framebuffer. The background color which the color buffer is cleared to can be specified via the setBackgroundColor(com.jme3.math.ColorRGBA) method.

A ViewPort has a list of SceneProcessors which can control how the ViewPort is rendered by the RenderManager.

関連項目:
RenderManager, SceneProcessor, Spatial, Camera

コンストラクタの概要
ViewPort(java.lang.String name, Camera cam)
          Create a new viewport.
 
メソッドの概要
 void addProcessor(SceneProcessor processor)
          Adds a SceneProcessor to this ViewPort.
 void attachScene(Spatial scene)
          Attaches a new scene to render in this ViewPort.
 void clearScenes()
          Removes all attached scenes.
 void detachScene(Spatial scene)
          Detaches a scene from rendering.
 ColorRGBA getBackgroundColor()
          Returns the background color of this ViewPort
 Camera getCamera()
          Returns the camera which renders the attached scenes.
 java.lang.String getName()
          Returns the name of the viewport as set in the constructor.
 FrameBuffer getOutputFrameBuffer()
          Returns the framebuffer where this ViewPort's scenes are rendered to.
 java.util.List<SceneProcessor> getProcessors()
          Get the list of scene processors that were added to this ViewPort
 RenderQueue getQueue()
          Internal use only.
 java.util.List<Spatial> getScenes()
          Returns a list of all attached scenes.
 boolean isClearColor()
          Check if color buffer clearing is enabled.
 boolean isClearDepth()
          Check if depth buffer clearing is enabled.
 boolean isClearStencil()
          Check if stencil buffer clearing is enabled.
 boolean isEnabled()
          Returns true if the viewport is enabled, false otherwise.
 void removeProcessor(SceneProcessor processor)
          Removes a SceneProcessor from this ViewPort.
 void setBackgroundColor(ColorRGBA background)
          Sets the background color.
 void setClearColor(boolean clearColor)
          Enable or disable clearing of the color buffer for this ViewPort.
 void setClearDepth(boolean clearDepth)
          Enable or disable clearing of the depth buffer for this ViewPort.
 void setClearFlags(boolean color, boolean depth, boolean stencil)
          Set the clear flags (color, depth, stencil) in one call.
 void setClearStencil(boolean clearStencil)
          Enable or disable clearing of the stencil buffer for this ViewPort.
 void setEnabled(boolean enable)
          Enable or disable this ViewPort.
 void setOutputFrameBuffer(FrameBuffer out)
          Sets the output framebuffer for the ViewPort.
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

ViewPort

public ViewPort(java.lang.String name,
                Camera cam)
Create a new viewport. User code should generally use these methods instead:

パラメータ:
name - The name of the viewport. Used for debugging only.
cam - The camera through which the viewport is rendered. The camera cannot be swapped to a different one after creating the viewport.
メソッドの詳細

getName

public java.lang.String getName()
Returns the name of the viewport as set in the constructor.

戻り値:
the name of the viewport
関連項目:
ViewPort(java.lang.String, com.jme3.renderer.Camera)

getProcessors

public java.util.List<SceneProcessor> getProcessors()
Get the list of scene processors that were added to this ViewPort

戻り値:
the list of processors attached to this ViewPort
関連項目:
addProcessor(com.jme3.post.SceneProcessor)

addProcessor

public void addProcessor(SceneProcessor processor)
Adds a SceneProcessor to this ViewPort.

SceneProcessors that are added to the ViewPort will be notified of events as the ViewPort is being rendered by the RenderManager.

パラメータ:
processor - The processor to add
関連項目:
SceneProcessor

removeProcessor

public void removeProcessor(SceneProcessor processor)
Removes a SceneProcessor from this ViewPort.

The processor will no longer receive events occurring to this ViewPort.

パラメータ:
processor - The processor to remove
関連項目:
SceneProcessor

isClearDepth

public boolean isClearDepth()
Check if depth buffer clearing is enabled.

戻り値:
true if depth buffer clearing is enabled.
関連項目:
setClearDepth(boolean)

setClearDepth

public void setClearDepth(boolean clearDepth)
Enable or disable clearing of the depth buffer for this ViewPort.

By default depth clearing is disabled.

パラメータ:
clearDepth - Enable/disable depth buffer clearing.

isClearColor

public boolean isClearColor()
Check if color buffer clearing is enabled.

戻り値:
true if color buffer clearing is enabled.
関連項目:
setClearColor(boolean)

setClearColor

public void setClearColor(boolean clearColor)
Enable or disable clearing of the color buffer for this ViewPort.

By default color clearing is disabled.

パラメータ:
clearDepth - Enable/disable color buffer clearing.

isClearStencil

public boolean isClearStencil()
Check if stencil buffer clearing is enabled.

戻り値:
true if stencil buffer clearing is enabled.
関連項目:
setClearStencil(boolean)

setClearStencil

public void setClearStencil(boolean clearStencil)
Enable or disable clearing of the stencil buffer for this ViewPort.

By default stencil clearing is disabled.

パラメータ:
clearDepth - Enable/disable stencil buffer clearing.

setClearFlags

public void setClearFlags(boolean color,
                          boolean depth,
                          boolean stencil)
Set the clear flags (color, depth, stencil) in one call.

パラメータ:
color - If color buffer clearing should be enabled.
depth - If depth buffer clearing should be enabled.
stencil - If stencil buffer clearing should be enabled.
関連項目:
setClearColor(boolean), setClearDepth(boolean), setClearStencil(boolean)

getOutputFrameBuffer

public FrameBuffer getOutputFrameBuffer()
Returns the framebuffer where this ViewPort's scenes are rendered to.

戻り値:
the framebuffer where this ViewPort's scenes are rendered to.
関連項目:
setOutputFrameBuffer(com.jme3.texture.FrameBuffer)

setOutputFrameBuffer

public void setOutputFrameBuffer(FrameBuffer out)
Sets the output framebuffer for the ViewPort.

The output framebuffer specifies where the scenes attached to this ViewPort are rendered to. By default this is null which indicates the scenes are rendered to the display window.

パラメータ:
out - The framebuffer to render scenes to, or null if to render to the screen.

getCamera

public Camera getCamera()
Returns the camera which renders the attached scenes.

戻り値:
the camera which renders the attached scenes.
関連項目:
Camera

getQueue

public RenderQueue getQueue()
Internal use only.


attachScene

public void attachScene(Spatial scene)
Attaches a new scene to render in this ViewPort.

パラメータ:
scene - The scene to attach
関連項目:
Spatial

detachScene

public void detachScene(Spatial scene)
Detaches a scene from rendering.

パラメータ:
scene - The scene to detach
関連項目:
attachScene(com.jme3.scene.Spatial)

clearScenes

public void clearScenes()
Removes all attached scenes.

関連項目:
attachScene(com.jme3.scene.Spatial)

getScenes

public java.util.List<Spatial> getScenes()
Returns a list of all attached scenes.

戻り値:
a list of all attached scenes.
関連項目:
attachScene(com.jme3.scene.Spatial)

setBackgroundColor

public void setBackgroundColor(ColorRGBA background)
Sets the background color.

When the ViewPort's color buffer is cleared (if color clearing is enabled), this specifies the color to which the color buffer is set to. By default the background color is black without alpha.

パラメータ:
background - the background color.

getBackgroundColor

public ColorRGBA getBackgroundColor()
Returns the background color of this ViewPort

戻り値:
the background color of this ViewPort
関連項目:
setBackgroundColor(com.jme3.math.ColorRGBA)

setEnabled

public void setEnabled(boolean enable)
Enable or disable this ViewPort.

Disabled ViewPorts are skipped by the RenderManager when rendering. By default all ViewPorts are enabled.

パラメータ:
enable - If the viewport should be disabled or enabled.

isEnabled

public boolean isEnabled()
Returns true if the viewport is enabled, false otherwise.

戻り値:
true if the viewport is enabled, false otherwise.
関連項目:
setEnabled(boolean)