public class View extends Object
The View object is the main Java 3D object for controlling the Java 3D viewing model. All of the components that specify the view transform used to render to the 3D canvases are either contained in the View object or in objects that are referenced by the View object.
Java 3D allows applications to specify multiple simultaneously active View objects, each controlling its own set of canvases.
The Java 3D View object has several instance variables and methods, but most are calibration variables or user-helping functions. The viewing policies defined by the View object are described below.
Policies
The View object defines the following policies:
screenScale = physicalScreenWidth / 2.0
screenScale
attribute (see the
setScreenScale method description).
The projection and clip parameters determine the view model's field of view and the front and back clipping distances.
There are several considerations to take into account when choosing values for the front and back clip distances.
There are five methods used to get information about system execution and performance:
getCurrentFrameStartTime
returns the time at which
the most recent rendering frame started.
getLastFrameDuration
returns the duration, in milliseconds, of
the most recently completed rendering frame.
getFrameNumber
returns the frame number for this view.
getMaxFrameStartTimes
retrieves the implementation-dependent
maximum number of frames whose start times will be recorded by
the system.
getFrameStartTimes
copies the last k frame start time values
into the user-specified array.
The following methods control the traversal, the rendering, and the execution of the behavior scheduler for this view:
startBehaviorScheduler
starts the behavior scheduler
running after it has been stopped.
stopBehaviorScheduler
stops the behavior scheduler after all
currently-scheduled behaviors are executed.
isBehaviorSchedulerRunning
retrieves a flag that indicates
whether the behavior scheduler is currently running.
startView
starts traversing this view and starts the renderers
associated with all canvases attached to this view.
stopView
stops traversing this view after the current state of
the scene graph is reflected on all canvases attached to this
view.
isViewRunning
returns a flag indicating whether the traverser
is currently running on this view.
Scene Antialiasing
The following methods set and retrieve the scene antialiasing flag. Scene antialiasing is either enabled or disabled for this view. If enabled, the entire scene will be antialiased on each canvas in which scene antialiasing is available. Scene antialiasing is disabled by default.
setSceneAntialiasingEnable
sets the scene antialiasing flag.
getSceneAntialiasingEnable
returns the scene antialiasing
flag.
Note: Scene antialiasing is ignored in pure immediate mode, but is supported in mixed-immediate mode.
Depth Buffer
The following two methods enable and disable automatic freezing of the depth buffer for objects rendered during the transparent rendering pass (that is, objects rendered using alpha blending) for this view. If enabled, depth buffer writes are disabled during the transparent rendering pass regardless of the value of the depth-buffer-write-enable flag in the RenderingAttributes object for a particular node. This flag is enabled by default.
setDepthBufferFreezeTransparent
enables depth buffer freezing.
getDepthBufferFreezeTransparent
retrieves the depth buffer
flag.
Sensors
The following methods retrieve the sensor's location in the virtual world:
getSensorToVworld
takes the sensor's last reading and
generates a sensor-to-vworld coordinate system transform. This
Transform3D object takes points in that sensor's local coordinate
system and transforms them into virtual world coordinates.
getSensorHotSpotInVworld
retrieves the specified sensor's
last hotspot location in virtual world coordinates.
A camera-based view model allows application programmers to think about the images displayed on the computer screen as if a virtual camera took those images. Such a view model allows application programmers to position and orient a virtual camera within a virtual scene, to manipulate some parameters of the virtual camera's lens (specify its field of view), and to specify the locations of the near and far clipping planes.
Java 3D allows applications to enable compatibility mode for room-mounted, non-head-tracked display environments, or to disable compatibility mode using the following methods. Camera-based viewing functions are only available in compatibility mode.
setCompatibilityModeEnable
turns compatibility mode on or off.
Compatibility mode is disabled by default.
getCompatabilityModeEnable
returns the compatibility mode
enable flag.
Setting the Viewing Transform
The View object provides the following compatibility-mode methods that operate on the viewing transform.
setVpcToEc
a compatibility mode method that
specifies the ViewPlatform
coordinates (VPC) to eye coordinates viewing transform.
getVpcToEc
returns the VPC.
The View object provides the following compatibility-mode methods that operate on the projection transform:
setLeftProjection
and setRightProjection
methods specify
a viewing frustum for the left and right eye that transforms
points in eye coordinates to clipping coordinates.
The getLeftProjection
and getRightProjection
methods return
the viewing frustum for the left and right eye.
Additional Information
For more information, see the Introduction to the Java 3D API and View Model documents.
Modifier and Type | Field and Description |
---|---|
static int |
CYCLOPEAN_EYE_VIEW
Specifies that monoscopic view generated should be the view as seen
from the 'center eye', the fictional eye half-way between the left and
right eye.
|
static int |
HMD_VIEW
Specifies that the viewing environment for this view is a
head-mounted display environment.
|
static int |
LEFT_EYE_VIEW
Specifies that monoscopic view generated should be the view as seen
from the left eye.
|
static int |
NOMINAL_FEET
Specifies a policy whereby the origin of physical or virtual
coordinates is relative to the position of the nominal feet.
|
static int |
NOMINAL_HEAD
Specifies a policy whereby the origin of physical or virtual
coordinates is relative to the position of the nominal head.
|
static int |
NOMINAL_SCREEN
Specifies a policy whereby the origin of physical or virtual
coordinates is relative to the screen.
|
static int |
PARALLEL_PROJECTION
Specifies that Java 3D should generate a parallel projection matrix
for this View.
|
static int |
PERSPECTIVE_PROJECTION
Specifies that Java 3D should generate a perspective projection matrix
for this View.
|
static int |
PHYSICAL_EYE
Specifies that the associated distance is measured
from the eye in meters.
|
static int |
PHYSICAL_SCREEN
Specifies that the associated distance is measured
from the screen in meters.
|
static int |
PHYSICAL_WORLD
Policy for resizing and moving windows.
|
static int |
RELATIVE_TO_COEXISTENCE
Policy for placing the eyepoint in non-head-tracked modes.
|
static int |
RELATIVE_TO_FIELD_OF_VIEW
Policy for placing the eyepoint in non-head-tracked modes.
|
static int |
RELATIVE_TO_SCREEN
Policy for placing the eyepoint in non-head-tracked modes.
|
static int |
RELATIVE_TO_WINDOW
Policy for placing the eyepoint in non-head-tracked modes.
|
static int |
RIGHT_EYE_VIEW
Specifies that monoscopic view generated should be the view as seen
from the right eye.
|
static int |
SCALE_EXPLICIT
Specifies that the screen scale for this view is taken directly
from the user-provided screenScale parameter.
|
static int |
SCALE_SCREEN_SIZE
Specifies that the screen scale for this view is derived from
the physical screen size.
|
static int |
SCREEN_VIEW
Specifies that the viewing environment for this view is a
standard screen-based display environment.
|
static int |
TRANSPARENCY_SORT_GEOMETRY
Policy that specifies that transparent objects
are sorted from back to front on a per-geometry basis.
|
static int |
TRANSPARENCY_SORT_NONE
Policy that specifies that no sorting of transparent objects
is done.
|
static int |
VIRTUAL_EYE
Specifies that the associated distance is measured
from the eye in virtual world coordinates.
|
static int |
VIRTUAL_SCREEN
Specifies that the associated distance is measured
from the screen in virtual world coordinates.
|
static int |
VIRTUAL_WORLD
Policy for resizing and moving windows.
|
static int |
VISIBILITY_DRAW_ALL
Policy that specifies that both visible and invisible objects
should be drawn.
|
static int |
VISIBILITY_DRAW_INVISIBLE
Policy that specifies that only invisible objects should be drawn.
|
static int |
VISIBILITY_DRAW_VISIBLE
Policy that specifies that only visible objects should be drawn.
|
Constructor and Description |
---|
View()
Constructs a View object with default parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
addCanvas3D(Canvas3D canvas3D)
Adds the given Canvas3D at the end of the list.
|
void |
attachViewPlatform(ViewPlatform vp)
Attach viewPlatform structure to this view.
|
Enumeration<Canvas3D> |
getAllCanvas3Ds()
Gets the enumeration object of all the Canvas3Ds.
|
double |
getBackClipDistance()
Returns the view model's back clip distance.
|
int |
getBackClipPolicy()
Returns the view model's current back clip policy.
|
Canvas3D |
getCanvas3D(int index)
Gets the Canvas3D at the specified index position.
|
boolean |
getCoexistenceCenteringEnable()
Retrieves the coexistenceCentering enable flag.
|
boolean |
getCompatibilityModeEnable()
Retrieves the compatibility mode enable flag.
|
long |
getCurrentFrameStartTime()
This method returns the time at which the most recent rendering
frame started.
|
boolean |
getDepthBufferFreezeTransparent()
Retrieves the current value of the depth buffer freeze transparent
flag for this view.
|
double |
getFieldOfView()
Returns the current field of view.
|
long |
getFrameNumber()
This method returns the frame number for this view.
|
long |
getFrameStartTimes(long[] times)
Copies the last k frame start time values into
the user-specified array.
|
double |
getFrontClipDistance()
Returns the view model's front clip distance.
|
int |
getFrontClipPolicy()
Returns the view model's current front clip policy.
|
long |
getLastFrameDuration()
This method returns the duration, in milliseconds, of the most
recently completed rendering frame.
|
void |
getLeftManualEyeInCoexistence(Point3d position)
Retrieves the position of the user-specified, manual left eye
in coexistence
coordinates and copies that value into the object provided.
|
void |
getLeftProjection(Transform3D projection)
Compatibility mode method that retrieves the current
compatibility mode projection transform for the left eye and
places it into the specified object.
|
boolean |
getLocalEyeLightingEnable()
Retrieves a flag that indicates whether or not local eye lighting
is enabled for this view.
|
static int |
getMaxFrameStartTimes()
Retrieves the implementation-dependent maximum number of
frames whose start times will be recorded by the system.
|
long |
getMinimumFrameCycleTime()
Retrieves the minimum frame cycle time, in milliseconds, for this view.
|
int |
getMonoscopicViewPolicy()
Deprecated.
As of Java 3D version 1.2, replaced by
Canvas3D.getMonoscopicViewPolicy |
PhysicalBody |
getPhysicalBody()
Returns a reference to the view model's PhysicalBody object.
|
PhysicalEnvironment |
getPhysicalEnvironment()
Returns a reference to the view model's PhysicalEnvironment object.
|
int |
getProjectionPolicy()
Retrieves the current projection policy for this View.
|
void |
getRightManualEyeInCoexistence(Point3d position)
Retrieves the position of the user-specified, manual right eye
in coexistence
coordinates and copies that value into the object provided.
|
void |
getRightProjection(Transform3D projection)
Compatibility mode method that retrieves the current
compatibility mode projection transform for the right eye and
places it into the specified object.
|
boolean |
getSceneAntialiasingEnable()
Returns a flag that indicates whether or not scene antialiasing
is enabled for this view.
|
double |
getScreenScale()
Returns the current screen scale value
|
int |
getScreenScalePolicy()
Returns the current screen scale policy, one of:
SCALE_SCREEN_SIZE or SCALE_EXPLICIT.
|
void |
getSensorHotspotInVworld(Sensor sensor,
Point3d position)
Retrieves the position of the specified Sensor's
hotspot in virtual-world coordinates
and copies that value into the position provided.
|
void |
getSensorHotspotInVworld(Sensor sensor,
Point3f position)
Retrieves the position of the specified Sensor's
hotspot in virtual-world coordinates
and copies that value into the position provided.
|
void |
getSensorToVworld(Sensor sensor,
Transform3D t)
Computes the sensor to virtual-world transform
and copies that value into the transform provided.
|
boolean |
getTrackingEnable()
Returns a status flag indicating whether or not head tracking
is enabled.
|
int |
getTransparencySortingPolicy()
Retrieves the current transparency sorting policy.
|
void |
getUserHeadToVworld(Transform3D t)
Retrieves the user-head to virtual-world transform
and copies that value into the transform provided.
|
boolean |
getUserHeadToVworldEnable()
Returns a status flag indicating whether or not
Java 3D is continuously updating the userHeadToVworldEnable transform.
|
ViewPlatform |
getViewPlatform()
Retrieves the currently attached ViewPlatform object
|
int |
getViewPolicy()
Retrieves the current view computation policy for this View.
|
int |
getVisibilityPolicy()
Retrieves the current visibility policy.
|
void |
getVpcToEc(Transform3D vpcToEc)
Compatibility mode method that retrieves the current
ViewPlatform Coordinates (VPC) system to
Eye Coordinates (EC) transform and copies it into the specified
object.
|
int |
getWindowEyepointPolicy()
Returns the current window eyepoint policy, one of:
RELATIVE_TO_SCREEN, RELATIVE_TO_WINDOW, RELATIVE_TO_FIELD_OF_VIEW or
RELATIVE_TO_COEXISTENCE.
|
int |
getWindowMovementPolicy()
Returns the current window movement policy,
one of: VIRTUAL_WORLD or PHYSICAL_WORLD.
|
int |
getWindowResizePolicy()
Returns the current window resize policy, one of:
VIRTUAL_WORLD or PHYSICAL_WORLD.
|
int |
indexOfCanvas3D(Canvas3D canvas3D)
Retrieves the index of the specified Canvas3D in
this View's list of Canvas3Ds
|
void |
insertCanvas3D(Canvas3D canvas3D,
int index)
Inserts the Canvas3D at the given index position.
|
boolean |
isBehaviorSchedulerRunning()
Retrieves a flag that indicates whether the behavior scheduler is
currently running.
|
boolean |
isViewRunning()
Retrieves a flag that indicates whether the traverser is
currently running on this view.
|
int |
numCanvas3Ds()
Returns the number of Canvas3Ds in this View.
|
void |
removeAllCanvas3Ds()
Removes all Canvas3Ds from this View.
|
void |
removeCanvas3D(Canvas3D canvas3D)
Removes the specified Canvas3D from this View's
list of Canvas3Ds.
|
void |
removeCanvas3D(int index)
Removes the Canvas3D from the given index position.
|
void |
renderOnce()
Renders one frame for a stopped View.
|
void |
repaint()
Requests that this View be scheduled for rendering as soon as
possible.
|
void |
setBackClipDistance(double distance)
Sets the view model's back clip distance.
|
void |
setBackClipPolicy(int policy)
Sets the view model's back clip policy, the policy Java 3D uses
in computing where to place the back clip plane.
|
void |
setCanvas3D(Canvas3D canvas3D,
int index)
Sets given Canvas3D at the given index position.
|
void |
setCoexistenceCenteringEnable(boolean flag)
Sets the coexistenceCentering enable flag to true or false.
|
void |
setCompatibilityModeEnable(boolean flag)
Sets the compatibility mode enable flag to true or false.
|
void |
setDepthBufferFreezeTransparent(boolean flag)
Enables or disables automatic freezing of the depth buffer for
objects rendered
during the transparent rendering pass (i.e., objects rendered
using alpha blending) for this view.
|
void |
setFieldOfView(double fieldOfView)
Sets the field of view used to compute the projection transform.
|
void |
setFrontClipDistance(double distance)
Sets the view model's front clip distance.
|
void |
setFrontClipPolicy(int policy)
Sets the view model's front clip policy, the policy Java 3D uses
in computing where to place the front clip plane.
|
void |
setLeftManualEyeInCoexistence(Point3d position)
Sets the position of the manual left eye in coexistence
coordinates.
|
void |
setLeftProjection(Transform3D projection)
Compatibility mode method that specifies a viewing frustum for
the left eye that transforms points in Eye Coordinates (EC) to
Clipping Coordinates (CC).
|
void |
setLocalEyeLightingEnable(boolean flag)
Sets a flag that indicates whether the local eyepoint is used in
lighting calculations for perspective projections.
|
void |
setMinimumFrameCycleTime(long minimumTime)
Sets the minimum frame cycle time, in milliseconds, for this
view.
|
void |
setMonoscopicViewPolicy(int policy)
Deprecated.
As of Java 3D version 1.2, replaced by
Canvas3D.setMonoscopicViewPolicy |
void |
setPhysicalBody(PhysicalBody physicalBody)
Sets the view model's physical body to the PhysicalBody object provided.
|
void |
setPhysicalEnvironment(PhysicalEnvironment physicalEnvironment)
Sets the view model's physical environment to the PhysicalEnvironment
object provided.
|
void |
setProjectionPolicy(int policy)
Sets the projection policy for this View.
|
void |
setRightManualEyeInCoexistence(Point3d position)
Sets the position of the manual right eye in coexistence
coordinates.
|
void |
setRightProjection(Transform3D projection)
Compatibility mode method that specifies a viewing frustum for
the right eye that transforms points in Eye Coordinates (EC) to
Clipping Coordinates (CC).
|
void |
setSceneAntialiasingEnable(boolean flag)
Enables or disables scene antialiasing for this view.
|
void |
setScreenScale(double scale)
Sets the screen scale value for this view.
|
void |
setScreenScalePolicy(int policy)
Sets the screen scale policy for this view.
|
void |
setTrackingEnable(boolean flag)
Turns head tracking on or off for this view.
|
void |
setTransparencySortingPolicy(int policy)
Sets the transparency sorting policy for this view.
|
void |
setUserHeadToVworldEnable(boolean flag)
Turns on or off the continuous
updating of the userHeadToVworld transform.
|
void |
setViewPolicy(int policy)
Sets the policy for view computation.
|
void |
setVisibilityPolicy(int policy)
Sets the visibility policy for this view.
|
void |
setVpcToEc(Transform3D vpcToEc)
Compatibility mode method that specifies the ViewPlatform
Coordinates (VPC) to Eye Coordinates (EC) transform.
|
void |
setWindowEyepointPolicy(int policy)
Sets the view model's window eyepoint policy.
|
void |
setWindowMovementPolicy(int policy)
Sets the window movement policy.
|
void |
setWindowResizePolicy(int policy)
Sets the window resize policy.
|
void |
startBehaviorScheduler()
Starts the behavior scheduler running after it has been stopped.
|
void |
startView()
Starts
traversing this view, and starts the renderers associated
with all canvases attached to this view.
|
long[] |
stopBehaviorScheduler()
Stops the behavior scheduler after all
currently scheduled behaviors are executed.
|
void |
stopView()
Stops traversing the scene graph for this
view after the current state of the scene graph is reflected on
all canvases attached to this view.
|
public static final int NOMINAL_HEAD
public static final int NOMINAL_FEET
public static final int NOMINAL_SCREEN
public static final int SCALE_SCREEN_SIZE
setScreenScalePolicy(int)
,
Constant Field Valuespublic static final int SCALE_EXPLICIT
public static final int VIRTUAL_SCREEN
public static final int PHYSICAL_SCREEN
public static final int VIRTUAL_EYE
public static final int PHYSICAL_EYE
public static final int VIRTUAL_WORLD
public static final int PHYSICAL_WORLD
public static final int RELATIVE_TO_SCREEN
public static final int RELATIVE_TO_WINDOW
public static final int RELATIVE_TO_FIELD_OF_VIEW
NOTE: when this policy is specified, the Z coordinate of the derived eyepoint is used in place of nominalEyeOffsetFromNominalScreen.
public static final int RELATIVE_TO_COEXISTENCE
setWindowEyepointPolicy(int)
,
Constant Field Valuespublic static final int LEFT_EYE_VIEW
public static final int RIGHT_EYE_VIEW
public static final int CYCLOPEAN_EYE_VIEW
public static final int SCREEN_VIEW
setViewPolicy(int)
,
Constant Field Valuespublic static final int HMD_VIEW
setViewPolicy(int)
,
Constant Field Valuespublic static final int PARALLEL_PROJECTION
setProjectionPolicy(int)
,
Constant Field Valuespublic static final int PERSPECTIVE_PROJECTION
setProjectionPolicy(int)
,
Constant Field Valuespublic static final int VISIBILITY_DRAW_VISIBLE
setVisibilityPolicy(int)
,
Constant Field Valuespublic static final int VISIBILITY_DRAW_INVISIBLE
setVisibilityPolicy(int)
,
Constant Field Valuespublic static final int VISIBILITY_DRAW_ALL
setVisibilityPolicy(int)
,
Constant Field Valuespublic static final int TRANSPARENCY_SORT_NONE
setTransparencySortingPolicy(int)
,
Constant Field Valuespublic static final int TRANSPARENCY_SORT_GEOMETRY
setTransparencySortingPolicy(int)
,
Constant Field Valuespublic View()
public void setViewPolicy(int policy)
policy
- the new policy, one of SCREEN_VIEW or HMD_VIEWIllegalArgumentException
- if policy is a value other than
SCREEN_VIEW or HMD_VIEWIllegalStateException
- if the specified policy
is HMD_VIEW and if any canvas associated with this view is
a stereo canvas with a monoscopicEyePolicy of CYCLOPEAN_EYE_VIEWpublic int getViewPolicy()
public void setProjectionPolicy(int policy)
policy
- the new policy, one of PARALLEL_PROJECTION or
PERSPECTIVE_PROJECTIONIllegalArgumentException
- if policy is a value other than
PARALLEL_PROJECTION or PERSPECTIVE_PROJECTIONpublic int getProjectionPolicy()
public void setScreenScalePolicy(int policy)
policy
- the new policy, one of SCALE_SCREEN_SIZE or
SCALE_EXPLICIT.public int getScreenScalePolicy()
public void setWindowResizePolicy(int policy)
policy
- the new policy, one of VIRTUAL_WORLD or PHYSICAL_WORLDpublic int getWindowResizePolicy()
public void setWindowMovementPolicy(int policy)
policy
- the new policy, one of VIRTUAL_WORLD or PHYSICAL_WORLDpublic int getWindowMovementPolicy()
public void setWindowEyepointPolicy(int policy)
policy
- the new policy, one of RELATIVE_TO_SCREEN,
RELATIVE_TO_WINDOW, RELATIVE_TO_FIELD_OF_VIEW, or
RELATIVE_TO_COEXISTENCEpublic int getWindowEyepointPolicy()
public void setMonoscopicViewPolicy(int policy)
Canvas3D.setMonoscopicViewPolicy
public int getMonoscopicViewPolicy()
Canvas3D.getMonoscopicViewPolicy
public void setCoexistenceCenteringEnable(boolean flag)
By default, coexistenceCentering is enabled. It should be disabled if the trackerBaseToImagePlate calibration transform is set to a value other than the identity (for example, when rendering to multiple screens or when head tracking is enabled). This flag is ignored for HMD mode, or when the coexistenceCenterInPworldPolicy is not NOMINAL_SCREEN.
flag
- the new coexistenceCentering enable flagpublic boolean getCoexistenceCenteringEnable()
public void setCompatibilityModeEnable(boolean flag)
flag
- the new compatibility mode enable flagpublic boolean getCompatibilityModeEnable()
public void setLeftProjection(Transform3D projection)
projection
- the new left eye projection transformRestrictedAccessException
- if compatibility mode is disabled.public void setRightProjection(Transform3D projection)
projection
- the new right eye projection transformRestrictedAccessException
- if compatibility mode is disabled.public void getLeftProjection(Transform3D projection)
projection
- the Transform3D object that will receive the
projectionRestrictedAccessException
- if compatibility mode is disabled.public void getRightProjection(Transform3D projection)
projection
- the Transform3D object that will receive the
projectionRestrictedAccessException
- if compatibility mode is disabled.public void setVpcToEc(Transform3D vpcToEc)
vpcToEc
- the new VPC to EC transformRestrictedAccessException
- if compatibility mode is disabled.BadTransformException
- if the transform is not affine.public void getVpcToEc(Transform3D vpcToEc)
vpcToEc
- the object that will receive the vpcToEc transform.RestrictedAccessException
- if compatibility mode is disabled.public void setPhysicalBody(PhysicalBody physicalBody)
physicalBody
- the new PhysicalBody objectpublic PhysicalBody getPhysicalBody()
public void setPhysicalEnvironment(PhysicalEnvironment physicalEnvironment)
physicalEnvironment
- the new PhysicalEnvironment objectpublic PhysicalEnvironment getPhysicalEnvironment()
public void setScreenScale(double scale)
scale
- the new screen scalepublic double getScreenScale()
public void setFieldOfView(double fieldOfView)
fieldOfView
- the new field of view in radianspublic double getFieldOfView()
public void setLeftManualEyeInCoexistence(Point3d position)
position
- the new manual left eye positionpublic void setRightManualEyeInCoexistence(Point3d position)
position
- the new manual right eye positionpublic void getLeftManualEyeInCoexistence(Point3d position)
position
- the object that will receive the positionpublic void getRightManualEyeInCoexistence(Point3d position)
position
- the object that will receive the positionpublic void setFrontClipDistance(double distance)
There are several considerations that need to be taken into account when choosing values for the front and back clip distances.
Float.MAX_VALUE
.
In practice, since these physical eye coordinate distances are in
meters, the values should be much less than that.
distance
- the new front clip distancesetBackClipDistance(double)
public double getFrontClipDistance()
public void setBackClipDistance(double distance)
There are several considerations that need to be taken into account when choosing values for the front and back clip distances. These are enumerated in the description of setFrontClipDistance.
Note that this attribute is only used if there is no Clip node that is in scope of the view platform associated with this view.
distance
- the new back clip distancesetFrontClipDistance(double)
,
Clip.setBackDistance(double)
public double getBackClipDistance()
public void getUserHeadToVworld(Transform3D t)
t
- the Transform3D object that will receive the transformpublic void setFrontClipPolicy(int policy)
policy
- the new policy, one of PHYSICAL_EYE, PHYSICAL_SCREEN,
VIRTUAL_EYE, or VIRTUAL_SCREENpublic int getFrontClipPolicy()
public void setBackClipPolicy(int policy)
policy
- the new policy, one of PHYSICAL_EYE, PHYSICAL_SCREEN,
VIRTUAL_EYE, or VIRTUAL_SCREENpublic int getBackClipPolicy()
public void setVisibilityPolicy(int policy)
policy
- the new policy, one of VISIBILITY_DRAW_VISIBLE,
VISIBILITY_DRAW_INVISIBLE, or VISIBILITY_DRAW_ALL.RenderingAttributes.setVisible(boolean)
public int getVisibilityPolicy()
public void setTransparencySortingPolicy(int policy)
policy
- the new policy, one of TRANSPARENCY_SORT_NONE
or TRANSPARENCY_SORT_GEOMETRY.public int getTransparencySortingPolicy()
public void setTrackingEnable(boolean flag)
flag
- specifies whether head tracking is enabled or
disabled for this viewpublic boolean getTrackingEnable()
public void setUserHeadToVworldEnable(boolean flag)
flag
- enables or disables continuous updatingpublic boolean getUserHeadToVworldEnable()
public void getSensorToVworld(Sensor sensor, Transform3D t)
sensor
- the sensor in questiont
- the object that will receive the transformpublic void getSensorHotspotInVworld(Sensor sensor, Point3f position)
sensor
- the sensor in questionposition
- the variable that will receive the positionpublic void getSensorHotspotInVworld(Sensor sensor, Point3d position)
sensor
- the sensor in questionposition
- the variable that will receive the positionpublic void setCanvas3D(Canvas3D canvas3D, int index)
canvas3D
- the given Canvas3D to be setindex
- the position to be setIllegalStateException
- if the specified canvas is
a stereo canvas with a monoscopicEyePolicy of CYCLOPEAN_EYE_VIEW,
and the viewPolicy for this view is HMD_VIEWIllegalSharingException
- if the specified canvas is
associated with another viewpublic Canvas3D getCanvas3D(int index)
index
- the position from which to get Canvas3D objectpublic Enumeration<Canvas3D> getAllCanvas3Ds()
public int numCanvas3Ds()
public void addCanvas3D(Canvas3D canvas3D)
canvas3D
- the Canvas3D to be addedIllegalStateException
- if the specified canvas is
a stereo canvas with a monoscopicEyePolicy of CYCLOPEAN_EYE_VIEW,
and the viewPolicy for this view is HMD_VIEWIllegalSharingException
- if the specified canvas is
associated with another viewpublic void insertCanvas3D(Canvas3D canvas3D, int index)
canvas3D
- the Canvas3D to be insertedindex
- the position to be inserted atIllegalStateException
- if the specified canvas is
a stereo canvas with a monoscopicEyePolicy of CYCLOPEAN_EYE_VIEW,
and the viewPolicy for this view is HMD_VIEWIllegalSharingException
- if the specified canvas is
associated with another viewpublic void removeCanvas3D(int index)
index
- the position of Canvas3D object to be removedpublic int indexOfCanvas3D(Canvas3D canvas3D)
canvas3D
- the Canvas3D to be looked up.public void removeCanvas3D(Canvas3D canvas3D)
canvas3D
- the Canvas3D to be removed.public void removeAllCanvas3Ds()
public long getCurrentFrameStartTime()
public long getLastFrameDuration()
public long getFrameNumber()
public static int getMaxFrameStartTimes()
public long getFrameStartTimes(long[] times)
setMinimumFrameCycleTime(long)
public void setMinimumFrameCycleTime(long minimumTime)
minimumTime
- the minimum number of milliseconds between
successive framesIllegalArgumentException
- if minimumTime < 0
getFrameStartTimes(long[])
public long getMinimumFrameCycleTime()
getFrameStartTimes(long[])
public void setDepthBufferFreezeTransparent(boolean flag)
flag
- indicates whether automatic freezing of the depth buffer
for transparent/antialiased objects is enabled.RenderingAttributes.setDepthBufferWriteEnable(boolean)
public boolean getDepthBufferFreezeTransparent()
public void setSceneAntialiasingEnable(boolean flag)
NOTE: Scene antialiasing is ignored in pure immediate mode, but is supported in mixed-immediate mode.
flag
- indicates whether scene antialiasing is enabledCanvas3D.queryProperties()
public boolean getSceneAntialiasingEnable()
public void setLocalEyeLightingEnable(boolean flag)
flag
- indicates whether local eye lighting is enabledpublic boolean getLocalEyeLightingEnable()
public void attachViewPlatform(ViewPlatform vp)
vp
- the viewPlatform to be attachedpublic ViewPlatform getViewPlatform()
public final long[] stopBehaviorScheduler()
NOTE: This is a heavy-weight method intended for verification and image capture (recording); it is not intended to be used for flow control.
IllegalStateException
- if this method is called
from a Behavior method or from any Canvas3D render callback
methodpublic final void startBehaviorScheduler()
IllegalStateException
- if this method is called
from a Behavior method or from any Canvas3D render callback
methodpublic final boolean isBehaviorSchedulerRunning()
IllegalStateException
- if this method is called
from a Behavior method or from any Canvas3D render callback
methodpublic final void stopView()
NOTE: This is a heavy-weight method intended for verification and image capture (recording); it is not intended to be used for flow control.
IllegalStateException
- if this method is called
from a Behavior method or from any Canvas3D render callback
methodpublic final void startView()
IllegalStateException
- if this method is called
from a Behavior method or from any Canvas3D render callback
methodpublic final boolean isViewRunning()
IllegalStateException
- if this method is called
from a Behavior method or from any Canvas3D render callback
methodpublic void renderOnce()
startView()
followed by
stopview()
, except that it is atomic, which
guarantees that only one frame is rendered.IllegalStateException
- if this method is called from
a Behavior method or from any Canvas3D render callback, or if
the view is currently running.public void repaint()
Copyright © 2016–2022 SciJava. All rights reserved.