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 classSceneCamera.AspectRatioControlMode 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 SceneCameraasCameraNode()Get a pointer to a CameraNode, if this is a CameraNode.voidattachTo(SceneNodePtr snode)Attach camera to scene node.voiddelete()doublegetAspectRatio()Get the aspect ratio.SceneCamera.AspectRatioControlgetAspectRatioControl()Get current mode of aspect ratio control.SceneNodePtrgetAttachedNode()Get the node attached to.intgetClearBufferMask()get the clear buffer mask that describe which buffers are cleared before drawingstatic longgetCPtr(SceneCamera obj)intgetDrawMask()Get the mask used when drawing in the scenejava.lang.StringgetName()get the camera nameProjectionMatrixgetProjectionMatrix()gets the projection matrixSceneNodePtrgetRefNode()get the reference nodeTransform3DgetTransform()get the camera transformvoidgetViewport(SWIGTYPE_p_int x, SWIGTYPE_p_int y, SWIGTYPE_p_int width, SWIGTYPE_p_int height)get viewport settingsbooleanisClearBufferEnabled()test if buffers is cleared before drawingbooleanisDepthTestEnabled()test if depth testing is enabledbooleanisEnabled()test if this camera is enabledbooleanisLightningEnabled()test if lightning is enabledvoidsetAspectRatioControl(SceneCamera.AspectRatioControl control)Change the mode for aspect ratio control.voidsetClearBufferEnabled(boolean enabled)set to true if the render buffer should be cleared before drawingvoidsetClearBufferMask(int mask)choose which buffers that should be clearedvoidsetDepthTestEnabled(boolean enabled)enable or disable the use of depth tests (depth buffer)voidsetDrawMask(int mask)set the mask used when drawing in the scenevoidsetEnabled(boolean enabled)enable or disable this cameravoidsetLightningEnabled(boolean enabled)enable or disable the use of lightningvoidsetPerspective(double fov, int w, int h, double zNear, double zFar)sets the projection matrix of this camera to be a perspective projectionvoidsetProjectionMatrix(ProjectionMatrix matrix)sets the current camera projection matrixvoidsetRefNode(SceneNodePtr snode)set the reference node of the cameravoidsetTransform(Transform3D t3d)set the camera transform relative to reference node (getRefNode)voidsetViewport(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:SceneNodeGet a pointer to a CameraNode, if this is a CameraNode.- Overrides:
asCameraNodein 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.
-
-