public class Camera3D extends java.lang.Object implements ICameraController
Constructor and Description |
---|
Camera3D()
Creates a new instance of
Camera3D |
Modifier and Type | Method and Description |
---|---|
void |
animate(Vector3 position,
Vector3 target,
long duration)
Animates camera to specified
position and target position with specified duration |
void |
animateZoomToFit(long duration)
Zooms camera to fit bounding box of parent surface inside the viewport using current camera position as reset position
|
void |
animateZoomToFit(Vector3 resetPosition,
long duration)
Zooms camera to fit bounding box of parent surface inside the viewport using current camera position as reset position
|
void |
attachTo(com.scichart.core.IServiceContainer services) |
float |
calculateRadiusAndTargetToFit(Vector3 targetToFit)
Calculates a Camera target and radius that will fit the bounding box completely inside the viewport.
|
void |
decrementSuspend() |
void |
detach() |
float |
getAspectRatio()
Gets the Aspect Ratio of the viewport, e.g.
|
ICameraAnimator |
getCameraAnimator()
Gets a
ICameraAnimator instance used to animate this camera. |
float |
getFarClip()
Gets the Far Clipping distance of the camera.
|
float |
getFieldOfView()
Gets the Field of View Angle of the Camera in Degrees
|
Vector3 |
getForward()
Calculated Property: Gets the Normalized Forward (direction) Vector of the Camera as an XYZ Vector3 in World Coordinates
|
boolean |
getIsSuspended() |
float |
getNearClip()
Gets the Near Clipping distance of the camera.
|
float |
getOrbitalPitch()
Gets the Pitch angle of the camera position relative to the target in DEGREES.
|
float |
getOrbitalYaw()
Gets the Yaw angle of the camera position relative to the target in DEGREES.
|
float |
getOrthoHeight()
Gets the Camera Orthogonal Viewport height, used when ProjectionMode is Orthogonal
|
float |
getOrthoWidth()
Gets the Camera Orthogonal Viewport width, used when ProjectionMode is Orthogonal
|
Vector3 |
getPosition()
Gets the Position of the Camera as an XYZ Vector3 in World Coordinates
|
CameraProjectionMode |
getProjectionMode()
Gets the Camera projection mode, e.g.
|
float |
getRadius()
Calculated Property: Gets the Radius distance of the camera to target in World Units.
|
com.scichart.core.IServiceContainer |
getServices() |
Vector3 |
getSide()
Calculated Property: Gets the Normalized Side Vector of the Camera as an XYZ Vector3 in World Coordinates
|
Vector3 |
getTarget()
Gets or sets the Target of the Camera as an XYZ Vector3 in World Coordinates
|
Vector3 |
getUp()
Calculated Property: Gets the Normalized Up Vector of the Camera as an XYZ Vector3 in World Coordinates
|
java.util.concurrent.atomic.AtomicInteger |
getUpdateSuspenderCount() |
boolean |
getZoomToFitOnAttach()
Gets whether or not the Camera should be zoomed to fit the parent scene bounds when it's attached
|
float |
getZoomToFitScaleFactor()
Gets the scale factor which is applied during calculation when Camera should be zoomed to fit the parent scene bounds
|
void |
invalidateElement() |
boolean |
isAttached() |
void |
resumeUpdates(com.scichart.core.framework.IUpdateSuspender suspender) |
void |
setAspectRatio(float aspectRatio)
Sets the Aspect Ratio of the viewport, e.g.
|
void |
setCameraAnimator(ICameraAnimator cameraAnimator)
Sets a
ICameraAnimator instance used to animate this camera. |
void |
setCameraUpdateListener(ICameraUpdateListener cameraUpdateListener)
Sets the
ICameraUpdateListener which is called when this ICameraController is updated |
void |
setFarClip(float farClip)
Sets the Far Clipping distance of the camera.
|
void |
setFieldOfView(float fieldOfView)
Sets the Field of View Angle of the Camera in Degrees
|
void |
setNearClip(float nearClip)
Sets the Near Clipping distance of the camera.
|
void |
setOrbitalPitch(float orbitalPitch)
Sets the Pitch angle of the camera position relative to the target in DEGREES.
|
void |
setOrbitalYaw(float orbitalVaw)
Sets the Yaw angle of the camera position relative to the target in DEGREES.
|
void |
setOrthoHeight(float orthoHeight)
Sets the Camera Orthogonal Viewport height, used when ProjectionMode is Orthogonal
|
void |
setOrthoWidth(float orthoWidth)
Sets the Camera Orthogonal Viewport width, used when ProjectionMode is Orthogonal
|
void |
setPosition(Vector3 position)
Sets the Position of the Camera as an XYZ Vector3 in World Coordinates
|
void |
setPositionAndTarget(Vector3 position,
Vector3 target)
Sets the Position and the Target of the Camera as XYZ Vector3 in World Coordinates and
|
void |
setProjectionMode(CameraProjectionMode projectionMode)
Sets the Camera projection mode, e.g.
|
void |
setRadius(float radius)
Calculated Property: Sets the Radius distance of the camera to target in World Units.
|
void |
setTarget(Vector3 target)
Sets the Target of the Camera as an XYZ Vector3 in World Coordinates
|
void |
setZoomToFitOnAttach(boolean zoomToFitOnAttach)
Sets whether or not the Camera should be zoomed to fit the parent scene bounds when it's attached
|
void |
setZoomToFitScaleFactor(float zoomToFitScaleFactor)
Sets the scale factor which is applied during calculation when Camera should be zoomed to fit the parent scene bounds
|
com.scichart.core.framework.IUpdateSuspender |
suspendUpdates() |
void |
toOrthogonal()
Switches the camera to Orthogonal mode
|
void |
toPerspective()
Switches the camera to Perspective mode
|
void |
update(RenderPassState3D renderPassState)
Updates the state of this
IUpdatable3D before rendering |
void |
zoomToFit()
Zooms camera to fit bounding box of parent surface inside the viewport using current camera position as reset position
|
void |
zoomToFit(Vector3 resetPosition)
Zooms camera to fit bounding box of parent surface inside the viewport using specified reset position
|
public Camera3D()
Camera3D
public final com.scichart.core.IServiceContainer getServices()
getServices
in interface com.scichart.core.IServiceProvider
public final ICameraAnimator getCameraAnimator()
ICameraAnimator
instance used to animate this camera.public final void setCameraAnimator(ICameraAnimator cameraAnimator)
ICameraAnimator
instance used to animate this camera.cameraAnimator
- a new ICameraAnimator
instance.public final Vector3 getPosition()
getPosition
in interface ICameraController
public final void setPosition(Vector3 position)
setPosition
in interface ICameraController
position
- The new position vectorpublic final Vector3 getTarget()
getTarget
in interface ICameraController
public void setTarget(Vector3 target)
setTarget
in interface ICameraController
target
- The new target vectorpublic final Vector3 getUp()
getUp
in interface ICameraController
public final Vector3 getForward()
getForward
in interface ICameraController
public final Vector3 getSide()
getSide
in interface ICameraController
public final float getFieldOfView()
getFieldOfView
in interface ICameraController
public void setFieldOfView(float fieldOfView)
setFieldOfView
in interface ICameraController
fieldOfView
- The new field of view valuepublic final float getNearClip()
getNearClip
in interface ICameraController
public void setNearClip(float nearClip)
setNearClip
in interface ICameraController
nearClip
- The new near clip valuepublic float getFarClip()
getFarClip
in interface ICameraController
public final void setFarClip(float farClip)
setFarClip
in interface ICameraController
farClip
- The new far clip valuepublic final float getOrbitalYaw()
getOrbitalYaw
in interface ICameraController
public final void setOrbitalYaw(float orbitalVaw)
setOrbitalYaw
in interface ICameraController
orbitalVaw
- The new yaw valuepublic final float getOrbitalPitch()
getOrbitalPitch
in interface ICameraController
public final void setOrbitalPitch(float orbitalPitch)
setOrbitalPitch
in interface ICameraController
orbitalPitch
- The new pitch valuepublic final float getRadius()
getRadius
in interface ICameraController
public final void setRadius(float radius)
setRadius
in interface ICameraController
radius
- The new radius valuepublic final float getAspectRatio()
getAspectRatio
in interface ICameraController
public final void setAspectRatio(float aspectRatio)
setAspectRatio
in interface ICameraController
aspectRatio
- The new aspect rationpublic final CameraProjectionMode getProjectionMode()
getProjectionMode
in interface ICameraController
public final void setProjectionMode(CameraProjectionMode projectionMode)
setProjectionMode
in interface ICameraController
projectionMode
- The new projection modepublic final float getOrthoWidth()
getOrthoWidth
in interface ICameraController
public final void setOrthoWidth(float orthoWidth)
setOrthoWidth
in interface ICameraController
orthoWidth
- The new ortho widthpublic final float getOrthoHeight()
getOrthoHeight
in interface ICameraController
public final void setOrthoHeight(float orthoHeight)
setOrthoHeight
in interface ICameraController
orthoHeight
- The new ortho heightpublic final boolean getZoomToFitOnAttach()
getZoomToFitOnAttach
in interface ICameraController
public final void setZoomToFitOnAttach(boolean zoomToFitOnAttach)
setZoomToFitOnAttach
in interface ICameraController
zoomToFitOnAttach
- The new zoomToFitOnAttach
valuepublic final float getZoomToFitScaleFactor()
getZoomToFitScaleFactor
in interface ICameraController
public final void setZoomToFitScaleFactor(float zoomToFitScaleFactor)
setZoomToFitScaleFactor
in interface ICameraController
zoomToFitScaleFactor
- The new scale factorpublic void setPositionAndTarget(Vector3 position, Vector3 target)
setPositionAndTarget
in interface ICameraController
position
- The new positiontarget
- The new targetpublic final void toOrthogonal()
toOrthogonal
in interface ICameraController
public final void toPerspective()
toPerspective
in interface ICameraController
public final boolean getIsSuspended()
getIsSuspended
in interface com.scichart.core.framework.ISuspendable
public final com.scichart.core.framework.IUpdateSuspender suspendUpdates()
suspendUpdates
in interface com.scichart.core.framework.ISuspendable
public void resumeUpdates(com.scichart.core.framework.IUpdateSuspender suspender)
resumeUpdates
in interface com.scichart.core.framework.ISuspendable
public void decrementSuspend()
decrementSuspend
in interface com.scichart.core.framework.ISuspendable
public final java.util.concurrent.atomic.AtomicInteger getUpdateSuspenderCount()
getUpdateSuspenderCount
in interface com.scichart.core.framework.ISuspendable
public void attachTo(com.scichart.core.IServiceContainer services)
attachTo
in interface com.scichart.core.framework.IAttachable
public void detach()
detach
in interface com.scichart.core.framework.IAttachable
public final boolean isAttached()
isAttached
in interface com.scichart.core.framework.IAttachable
public void invalidateElement()
invalidateElement
in interface com.scichart.core.framework.IInvalidatableElement
public void update(RenderPassState3D renderPassState)
IUpdatable3D
before renderingupdate
in interface IUpdatable3D
renderPassState
- The RenderPassState3D
used in current render passpublic float calculateRadiusAndTargetToFit(Vector3 targetToFit)
calculateRadiusAndTargetToFit
in interface ICameraController
targetToFit
- The camera target to fit the bounding box completely inside the viewport.public final void zoomToFit()
zoomToFit
in interface ICameraController
public final void zoomToFit(Vector3 resetPosition)
zoomToFit
in interface ICameraController
resetPosition
- The reset position to usepublic final void animateZoomToFit(long duration)
animateZoomToFit
in interface ICameraController
duration
- The duration of animation when zooming to fit bounding boxpublic final void animateZoomToFit(Vector3 resetPosition, long duration)
animateZoomToFit
in interface ICameraController
resetPosition
- The reset position to useduration
- The duration of animation when zooming to fit bounding boxpublic final void animate(Vector3 position, Vector3 target, long duration)
position
and target
position with specified durationanimate
in interface ICameraController
position
- The final position of cameratarget
- The final target of cameraduration
- The animation durationpublic void setCameraUpdateListener(ICameraUpdateListener cameraUpdateListener)
ICameraController
ICameraUpdateListener
which is called when this ICameraController
is updatedsetCameraUpdateListener
in interface ICameraController
cameraUpdateListener
- The listener to set