Package org.robwork.sdurw_graphics
Class SceneCamera
- java.lang.Object
-
- org.robwork.sdurw_graphics.SceneNode
-
- org.robwork.sdurw_graphics.SceneCamera
-
public class SceneCamera extends SceneNode
Node representing a camera in the scene. A SceneCamera sets up everything
from rendering buffer to perspective transform.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SceneCamera.AspectRatioControl
Mode for aspect ratio control.-
Nested classes/interfaces inherited from class org.robwork.sdurw_graphics.SceneNode
SceneNode.AddPolicy, SceneNode.NodeType
-
-
Constructor Summary
Constructors Constructor Description SceneCamera(long cPtr, boolean cMemoryOwn)
SceneCamera(java.lang.String name, SceneNodePtr subGraph)
constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SceneCamera
asCameraNode()
Get a pointer to a CameraNode, if this is a CameraNode.void
attachTo(SceneNodePtr snode)
Attach camera to scene node.void
delete()
double
getAspectRatio()
Get the aspect ratio.SceneCamera.AspectRatioControl
getAspectRatioControl()
Get current mode of aspect ratio control.SceneNodePtr
getAttachedNode()
Get the node attached to.int
getClearBufferMask()
get the clear buffer mask that describe which buffers are cleared before drawingstatic long
getCPtr(SceneCamera obj)
int
getDrawMask()
Get the mask used when drawing in the scenejava.lang.String
getName()
get the camera nameProjectionMatrix
getProjectionMatrix()
gets the projection matrixSceneNodePtr
getRefNode()
get the reference nodeTransform3D
getTransform()
get the camera transformvoid
getViewport(SWIGTYPE_p_int x, SWIGTYPE_p_int y, SWIGTYPE_p_int width, SWIGTYPE_p_int height)
get viewport settingsboolean
isClearBufferEnabled()
test if buffers is cleared before drawingboolean
isDepthTestEnabled()
test if depth testing is enabledboolean
isEnabled()
test if this camera is enabledboolean
isLightningEnabled()
test if lightning is enabledvoid
setAspectRatioControl(SceneCamera.AspectRatioControl control)
Change the mode for aspect ratio control.void
setClearBufferEnabled(boolean enabled)
set to true if the render buffer should be cleared before drawingvoid
setClearBufferMask(int mask)
choose which buffers that should be clearedvoid
setDepthTestEnabled(boolean enabled)
enable or disable the use of depth tests (depth buffer)void
setDrawMask(int mask)
set the mask used when drawing in the scenevoid
setEnabled(boolean enabled)
enable or disable this cameravoid
setLightningEnabled(boolean enabled)
enable or disable the use of lightningvoid
setPerspective(double fov, int w, int h, double zNear, double zFar)
sets the projection matrix of this camera to be a perspective projectionvoid
setProjectionMatrix(ProjectionMatrix matrix)
sets the current camera projection matrixvoid
setRefNode(SceneNodePtr snode)
set the reference node of the cameravoid
setTransform(Transform3D t3d)
set the camera transform relative to reference node (getRefNode)void
setViewport(int x, int y, int width, int height)
set viewport settings-
Methods inherited from class org.robwork.sdurw_graphics.SceneNode
addParent, addParent, asDrawableNode, asGroupNode, get_name, get_parentNodes, get_type, getCPtr, getType, hasParent, removeParent, removeParent, set_name, set_parentNodes, set_type, setName
-
-
-
-
Constructor Detail
-
SceneCamera
public SceneCamera(long cPtr, boolean cMemoryOwn)
-
SceneCamera
public SceneCamera(java.lang.String name, SceneNodePtr subGraph)
constructor- Parameters:
name
- [in] name of camerasubGraph
- [in] the root of the subgraph that this camera is supposed to render.
-
-
Method Detail
-
getCPtr
public static long getCPtr(SceneCamera obj)
-
setPerspective
public void setPerspective(double fov, int w, int h, double zNear, double zFar)
sets the projection matrix of this camera to be a perspective projection- Parameters:
fov
- [in] field of view in radians.w
- [in] view widthh
- [in] view heightzNear
- [in] near clipping planezFar
- [in] far clipping plane
-
getProjectionMatrix
public ProjectionMatrix getProjectionMatrix()
gets the projection matrix- Returns:
- the current camera projection matrix
-
setProjectionMatrix
public void setProjectionMatrix(ProjectionMatrix matrix)
sets the current camera projection matrix- Parameters:
matrix
- [in] a projection matrix
-
setViewport
public void setViewport(int x, int y, int width, int height)
set viewport settings
-
getViewport
public void getViewport(SWIGTYPE_p_int x, SWIGTYPE_p_int y, SWIGTYPE_p_int width, SWIGTYPE_p_int height)
get viewport settings
-
setClearBufferEnabled
public void setClearBufferEnabled(boolean enabled)
set to true if the render buffer should be cleared before drawing
-
isClearBufferEnabled
public boolean isClearBufferEnabled()
test if buffers is cleared before drawing
-
setClearBufferMask
public void setClearBufferMask(int mask)
choose which buffers that should be cleared
-
getClearBufferMask
public int getClearBufferMask()
get the clear buffer mask that describe which buffers are cleared before drawing
-
setDepthTestEnabled
public void setDepthTestEnabled(boolean enabled)
enable or disable the use of depth tests (depth buffer)
-
isDepthTestEnabled
public boolean isDepthTestEnabled()
test if depth testing is enabled
-
setLightningEnabled
public void setLightningEnabled(boolean enabled)
enable or disable the use of lightning
-
isLightningEnabled
public boolean isLightningEnabled()
test if lightning is enabled
-
getRefNode
public SceneNodePtr getRefNode()
get the reference node
-
setRefNode
public void setRefNode(SceneNodePtr snode)
set the reference node of the camera
-
isEnabled
public boolean isEnabled()
test if this camera is enabled
-
setEnabled
public void setEnabled(boolean enabled)
enable or disable this camera
-
asCameraNode
public SceneCamera asCameraNode()
Description copied from class:SceneNode
Get a pointer to a CameraNode, if this is a CameraNode.- Overrides:
asCameraNode
in classSceneNode
- Returns:
- a pointer, or NULL if the SceneNode is not of correct type.
-
setTransform
public void setTransform(Transform3D t3d)
set the camera transform relative to reference node (getRefNode)
-
getTransform
public Transform3D getTransform()
get the camera transform
-
setAspectRatioControl
public void setAspectRatioControl(SceneCamera.AspectRatioControl control)
Change the mode for aspect ratio control.- Parameters:
control
- [in] new mode.
-
getAspectRatioControl
public SceneCamera.AspectRatioControl getAspectRatioControl()
Get current mode of aspect ratio control.- Returns:
- the current mode.
-
setDrawMask
public void setDrawMask(int mask)
set the mask used when drawing in the scene- Parameters:
mask
- [in] The draw mask - see DrawableNode::DrawableTypeMask.
-
getDrawMask
public int getDrawMask()
Get the mask used when drawing in the scene- Returns:
- the draw mask - see DrawableNode::DrawableTypeMask.
-
getName
public java.lang.String getName()
get the camera name
-
attachTo
public void attachTo(SceneNodePtr snode)
Attach camera to scene node.- Parameters:
snode
- [in] node to attach to.
-
getAttachedNode
public SceneNodePtr getAttachedNode()
Get the node attached to.- Returns:
- the node.
-
getAspectRatio
public double getAspectRatio()
Get the aspect ratio.- Returns:
- the aspect ratio.
-
-