|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xith3d.scenegraph.SceneGraphObject
org.xith3d.scenegraph.View
public class View
The View defines a Camera or an Eye to tell OpenGL of the perspective to render from.
| Nested Class Summary | |
|---|---|
static class |
View.CameraMode
Camera mode for a View. |
static class |
View.ProjectionPolicy
Projection policy to render from. |
| Field Summary | |
|---|---|
static float |
DEFAULT_BACK_CLIP_DISTANCE_PARALLEL
The default back clip distance (far clip plane) for parallel projection mode. |
static float |
DEFAULT_BACK_CLIP_DISTANCE_PERSPECTIVE
The default back clip distance (far clip plane) for perspective projection mode. |
static float |
DEFAULT_FIELD_OF_VIEW
The default field of view (FOV) |
static float |
DEFAULT_FRONT_CLIP_DISTANCE_PARALLEL
The default front clip distance (near clip plane) for parallel projection mode. |
static float |
DEFAULT_FRONT_CLIP_DISTANCE_PERSPECTIVE
The default front clip distance (near clip plane) for perspective projection mode. |
static View.ProjectionPolicy |
PARALLEL_PROJECTION
Render the scene in parallel projection mode |
static View.ProjectionPolicy |
PERSPECTIVE_PROJECTION
Render the scene in perspective projection mode |
| Fields inherited from class org.xith3d.scenegraph.SceneGraphObject |
|---|
XITH3D_USERDATAKEY_OLDUSERDATA |
| Constructor Summary | |
|---|---|
View()
Constructs a new View. |
|
View(float eyePositionX,
float eyePositionY,
float eyePositionZ,
float viewFocusX,
float viewFocusY,
float viewFocusZ,
float vecUpX,
float vecUpY,
float vecUpZ)
Creates a new View. |
|
View(org.openmali.vecmath2.Tuple3f eyePosition,
org.openmali.vecmath2.Tuple3f viewFocus,
org.openmali.vecmath2.Tuple3f vecUp)
Creates a new View. |
|
| Method Summary | ||
|---|---|---|
void |
addCanvas3D(Canvas3D canvas3D)
Adds a Canvas3D to this view. |
|
void |
addCanvas3D(Canvas3D canvas,
int index)
Adds a Canvas3D at the specified index. |
|
Transform3D |
calculatePerspective(float viewportWidth,
float viewportHeight)
|
|
Transform3D |
calculatePerspective(org.openmali.types.twodee.Sized2iRO viewport)
|
|
PointLight |
getAttachedLight()
|
|
float |
getBackClipDistance()
|
|
Canvas3D |
getCanvas3D(int index)
|
|
java.util.List<Canvas3D> |
getCanvas3Ds()
|
|
org.openmali.vecmath2.Tuple2f |
getCenterOfView()
|
|
org.openmali.vecmath2.Vector3f |
getFacingDirection()
Calculates and returns the direction, the view faces. |
|
|
getFacingDirection(T direction)
Calculates the direction, the view faces and fills the values into the given Tuple3f. |
|
float |
getFieldOfView()
|
|
float |
getFrontClipDistance()
|
|
org.openmali.spatial.bodies.Frustum |
getFrustum(float viewportWidth,
float viewportHeight)
Calculates and returns the View's frustum. |
|
org.openmali.spatial.bodies.Frustum |
getFrustum(org.openmali.types.twodee.Sized2iRO viewport)
Calculates and returns the View's frustum. |
|
Transform3D |
getModelViewTransform(boolean forceRecomputation)
Gets model-view transform for the NORMAL camera mode. |
|
Transform3D |
getModelViewTransform(View.CameraMode mode,
boolean forceRecomputation)
Gets model-view transform adjusting it depending on the camera mode. |
|
org.openmali.vecmath2.Point3f |
getPosition()
Retrieves and returns the View's position from its Transform3D. |
|
void |
getPosition(org.openmali.vecmath2.Tuple3f position)
Retrieves the View's position from its Transform3D and writes it into position. |
|
Transform3D |
getProjection()
|
|
View.ProjectionPolicy |
getProjectionPolicy()
|
|
org.openmali.vecmath2.Vector3f |
getRightDirection()
Calculates and returns the direction to the right. |
|
|
getRightDirection(T direction)
Calculates the direction to the right and fills the values into the given Tuple3f. |
|
float |
getScreenScale()
|
|
float |
getSoundActivationRadius()
|
|
Transform3D |
getTransform()
Gets the transform for this object. |
|
void |
getTransform(Transform3D transform)
Gets the transform for this object. |
|
org.openmali.vecmath2.Vector3f |
getUpDirection()
Calculates and returns the direction heading up. |
|
|
getUpDirection(T direction)
Calculates the direction heading up and fills the values into the given Tuple3f. |
|
int |
indexOfCanvas3D(Canvas3D canvas)
|
|
void |
lookAlong(float eyePositionX,
float eyePositionY,
float eyePositionZ,
float viewDirectionX,
float viewDirectionY,
float viewDirectionZ)
Helping function that specifies the position and orientation of a view matrix. |
|
void |
lookAlong(float eyePositionX,
float eyePositionY,
float eyePositionZ,
float viewDirectionX,
float viewDirectionY,
float viewDirectionZ,
float vecUpX,
float vecUpY,
float vecUpZ)
Helping function that specifies the position and orientation of a view matrix. |
|
void |
lookAlong(org.openmali.vecmath2.Tuple3f eyePosition,
org.openmali.vecmath2.Tuple3f viewDirection)
Helping function that specifies the position and orientation of a view matrix. |
|
void |
lookAlong(org.openmali.vecmath2.Tuple3f eyePosition,
org.openmali.vecmath2.Tuple3f viewDirection,
org.openmali.vecmath2.Tuple3f vecUp)
Helping function that specifies the position and orientation of a view matrix. |
|
void |
lookAt(float eyePositionX,
float eyePositionY,
float eyePositionZ,
float viewFocusX,
float viewFocusY,
float viewFocusZ,
float vecUpX,
float vecUpY,
float vecUpZ)
Helper function that specifies the position and orientation of a view matrix. |
|
void |
lookAt(org.openmali.vecmath2.Tuple3f viewFocus)
Helper function that specifies the position and orientation of a view matrix. |
|
void |
lookAt(org.openmali.vecmath2.Tuple3f eyePosition,
org.openmali.vecmath2.Tuple3f viewFocus,
org.openmali.vecmath2.Tuple3f vecUp)
Helper function that specifies the position and orientation of a view matrix. |
|
int |
numCanvas3Ds()
|
|
void |
removeCanvas3D(Canvas3D canvas)
|
|
Canvas3D |
removeCanvas3D(int index)
|
|
void |
setAttachedLight(PointLight light)
Attaches a PointLight/SpotLight to this View (or detaches if for null). |
|
void |
setBackClipDistance(float value)
Sets the back clip distance (far clip plane) for this View. |
|
void |
setCenterOfView(org.openmali.vecmath2.Tuple2f cov)
Sets the center of the View. |
|
void |
setFacingDirection(org.openmali.vecmath2.Vector3f direction)
Sets the direction in which the view looks. |
|
void |
setFieldOfView(float value)
Sets the field of view (viewing angle). |
|
void |
setFrontClipDistance(float value)
Sets the front clip distance (near clip plane) for this View. |
|
void |
setPosition(float posX,
float posY,
float posZ)
Repositions the TransformNode |
|
void |
setPosition(org.openmali.vecmath2.Tuple3f position)
Repositions the TransformNode |
|
void |
setProjection(Transform3D customProjection)
Sets the custom projection transform. |
|
void |
setProjectionPolicy(View.ProjectionPolicy policy)
Sets the projection policy. |
|
void |
setScreenScale(float screenScale)
Sets the screen scale. |
|
void |
setSoundActivationRadius(float radius)
Set the sound activation radius. |
|
void |
setTransform(Transform3D transform)
Sets the transform for this object. |
|
| Methods inherited from class org.xith3d.scenegraph.SceneGraphObject |
|---|
getName, getUserData, getUserData, getUserDataMap, isLive, setLive, setName, setUserData, setUserData, setUserDataRecursive, setUserDataRecursive, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.xith3d.scenegraph.Transformable |
|---|
getName, setName |
| Field Detail |
|---|
public static final View.ProjectionPolicy PARALLEL_PROJECTION
public static final View.ProjectionPolicy PERSPECTIVE_PROJECTION
public static final float DEFAULT_FIELD_OF_VIEW
public static final float DEFAULT_FRONT_CLIP_DISTANCE_PERSPECTIVE
public static final float DEFAULT_FRONT_CLIP_DISTANCE_PARALLEL
public static final float DEFAULT_BACK_CLIP_DISTANCE_PERSPECTIVE
public static final float DEFAULT_BACK_CLIP_DISTANCE_PARALLEL
| Constructor Detail |
|---|
public View(float eyePositionX,
float eyePositionY,
float eyePositionZ,
float viewFocusX,
float viewFocusY,
float viewFocusZ,
float vecUpX,
float vecUpY,
float vecUpZ)
eyePositionX - the center of the eyeeyePositionY - the center of the eyeeyePositionZ - the center of the eyeviewFocusX - the point the view looks atviewFocusY - the point the view looks atviewFocusZ - the point the view looks atvecUpX - the vector pointing upvecUpY - the vector pointing upvecUpZ - the vector pointing up
public View(org.openmali.vecmath2.Tuple3f eyePosition,
org.openmali.vecmath2.Tuple3f viewFocus,
org.openmali.vecmath2.Tuple3f vecUp)
eyePosition - the environment's view's locationviewFocus - the environment's view's center (where to look at)vecUp - the environment's view's normal which is pointing uppublic View()
| Method Detail |
|---|
public final void setAttachedLight(PointLight light)
PointLight/SpotLight to this View (or detaches if for null).
light - public final PointLight getAttachedLight()
PointLight/SpotLight.public final void setProjectionPolicy(View.ProjectionPolicy policy)
public final View.ProjectionPolicy getProjectionPolicy()
public final void setCenterOfView(org.openmali.vecmath2.Tuple2f cov)
cov - values range from 1 (left) to -1 (right) a value of null
sets the center to (0|0) - the defaultpublic final org.openmali.vecmath2.Tuple2f getCenterOfView()
public final void setScreenScale(float screenScale)
public final float getScreenScale()
public final void setFrontClipDistance(float value)
public final float getFrontClipDistance()
public final void setBackClipDistance(float value)
public final float getBackClipDistance()
public final void setFieldOfView(float value)
public final float getFieldOfView()
public final void setSoundActivationRadius(float radius)
radius - the new sound activation radiuspublic final float getSoundActivationRadius()
public final void setTransform(Transform3D transform)
setTransform in interface Transformablepublic final Transform3D getTransform()
getTransform in interface Transformablepublic final void getTransform(Transform3D transform)
getTransform in interface Transformable
public void setPosition(float posX,
float posY,
float posZ)
setPosition in interface TransformableposX - the new x-positionposY - the new y-positionposZ - the new z-positionpublic final void setPosition(org.openmali.vecmath2.Tuple3f position)
setPosition in interface Transformableposition - the new positionpublic final void getPosition(org.openmali.vecmath2.Tuple3f position)
getPosition in interface Transformableposition - the tuple to write the positional data into.public final org.openmali.vecmath2.Point3f getPosition()
getPosition in interface Transformable
public final void lookAt(float eyePositionX,
float eyePositionY,
float eyePositionZ,
float viewFocusX,
float viewFocusY,
float viewFocusZ,
float vecUpX,
float vecUpY,
float vecUpZ)
eyePositionX - the center of the eyeeyePositionY - the center of the eyeeyePositionZ - the center of the eyeviewFocusX - the point the view looks atviewFocusY - the point the view looks atviewFocusZ - the point the view looks atvecUpX - the vector pointing upvecUpY - the vector pointing upvecUpZ - the vector pointing up
public final void lookAt(org.openmali.vecmath2.Tuple3f eyePosition,
org.openmali.vecmath2.Tuple3f viewFocus,
org.openmali.vecmath2.Tuple3f vecUp)
eyePosition - the center of the eyeviewFocus - the point the view looks atvecUp - the vector pointing uppublic final void lookAt(org.openmali.vecmath2.Tuple3f viewFocus)
viewFocus - the point the view looks at
public final void lookAlong(float eyePositionX,
float eyePositionY,
float eyePositionZ,
float viewDirectionX,
float viewDirectionY,
float viewDirectionZ,
float vecUpX,
float vecUpY,
float vecUpZ)
eyePositionX - the center of the eyeeyePositionY - the center of the eyeeyePositionZ - the center of the eyeviewDirectionX - the direction the view looks alongviewDirectionY - the direction the view looks alongviewDirectionZ - the direction the view looks alongvecUpX - the vector pointing upvecUpY - the vector pointing upvecUpZ - the vector pointing up
public final void lookAlong(org.openmali.vecmath2.Tuple3f eyePosition,
org.openmali.vecmath2.Tuple3f viewDirection,
org.openmali.vecmath2.Tuple3f vecUp)
eyePosition - the center of the eyeviewDirection - the direction the view looks alongvecUp - the vector pointing up
public final void lookAlong(float eyePositionX,
float eyePositionY,
float eyePositionZ,
float viewDirectionX,
float viewDirectionY,
float viewDirectionZ)
eyePositionX - the center of the eyeeyePositionY - the center of the eyeeyePositionZ - the center of the eyeviewDirectionX - the direction the view looks alongviewDirectionY - the direction the view looks alongviewDirectionZ - the direction the view looks along
public final void lookAlong(org.openmali.vecmath2.Tuple3f eyePosition,
org.openmali.vecmath2.Tuple3f viewDirection)
eyePosition - the center of the eyeviewDirection - the direction the view looks alongpublic final void setFacingDirection(org.openmali.vecmath2.Vector3f direction)
direction - public final <T extends org.openmali.vecmath2.Tuple3f> T getFacingDirection(T direction)
direction - the Tuple3f to be filled up with the resultpublic final org.openmali.vecmath2.Vector3f getFacingDirection()
public final <T extends org.openmali.vecmath2.Tuple3f> T getRightDirection(T direction)
direction - the Tuple3f to be filled up with the resultpublic final org.openmali.vecmath2.Vector3f getRightDirection()
public final <T extends org.openmali.vecmath2.Tuple3f> T getUpDirection(T direction)
direction - the Tuple3f to be filled up with the resultpublic final org.openmali.vecmath2.Vector3f getUpDirection()
public final Transform3D getModelViewTransform(View.CameraMode mode,
boolean forceRecomputation)
mode - VIEW_NORMAL will return the standard view,
VIEW_FIXED_POSITION will return only the rotational component
of the standard view (the position is left as the identity),
VIEW_FIXED returns the identity matrix.forceRecomputation - if true, the model-view-transform is guaranteed to be recalculatedpublic final Transform3D getModelViewTransform(boolean forceRecomputation)
forceRecomputation - if true, the model-view-transform is guaranteed to be recalculated
public Transform3D calculatePerspective(float viewportWidth,
float viewportHeight)
public final Transform3D calculatePerspective(org.openmali.types.twodee.Sized2iRO viewport)
public void setProjection(Transform3D customProjection)
customProjection - public final Transform3D getProjection()
public final org.openmali.spatial.bodies.Frustum getFrustum(float viewportWidth,
float viewportHeight)
viewportWidth - the canvas width the take for calculationviewportHeight - the canvas height the take for calculation
public final org.openmali.spatial.bodies.Frustum getFrustum(org.openmali.types.twodee.Sized2iRO viewport)
viewport - the viewport size the take for calculation
public void addCanvas3D(Canvas3D canvas3D)
canvas3D - the canvas to be added
public final void addCanvas3D(Canvas3D canvas,
int index)
canvas - the Canvas3D to addindex - the new index of the Canvas3Dpublic final Canvas3D removeCanvas3D(int index)
public void removeCanvas3D(Canvas3D canvas)
public final Canvas3D getCanvas3D(int index)
public final int indexOfCanvas3D(Canvas3D canvas)
public final int numCanvas3Ds()
public final java.util.List<Canvas3D> getCanvas3Ds()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||