iOS & macOS Charting Documentation - SciChart iOS & macOS Charts SDK v4.x
ISCICameraController
@protocol
ISCICameraController <ISCIInvalidatableElement, ISCISuspendable,
ISCIAttachable, ISCIServiceProvider, ISCIUpdatable3D>
Defines the interface to a Camera in the SCIChartSurface3D
scene.
-
Defines the Position of the Camera as an XYZ vector in World Coordinates.
Declaration
Objective-C
@property (nonatomic, strong) SCIVector3 *_Nonnull position;
Swift
var position: SCIVector3 { get set }
-
Defines the Target of the Camera as an XYZ vector in World Coordinates.
Declaration
Objective-C
@property (nonatomic, strong) SCIVector3 *_Nonnull target;
Swift
var target: SCIVector3 { get set }
-
Gets the Normalized Up Vector of the Camera as an XYZ vector in World Coordinates.
Note
This property isComputed
.Declaration
Objective-C
@property (nonatomic, readonly) SCIVector3 *_Nonnull up;
Swift
var up: SCIVector3 { get }
-
Gets the Normalized Forward (direction) Vector of the Camera as an XYZ vector in World Coordinates.
Note
This property isComputed
.Declaration
Objective-C
@property (nonatomic, readonly) SCIVector3 *_Nonnull forward;
Swift
var forward: SCIVector3 { get }
-
Gets the Normalized Side Vector of the Camera as an XYZ vector in World Coordinates.
Note
This property isComputed
.Declaration
Objective-C
@property (nonatomic, readonly) SCIVector3 *_Nonnull side;
Swift
var side: SCIVector3 { get }
-
Defines the Field of View Angle of the Camera in
Degrees
.Declaration
Objective-C
@property (nonatomic) float fieldOfView;
Swift
var fieldOfView: Float { get set }
-
Defines the Near Clipping distance of the camera.
Warning
Objects closer than this distance will be invisible to the camera.Declaration
Objective-C
@property (nonatomic) float nearClip;
Swift
var nearClip: Float { get set }
-
Defines the Far Clipping distance of the camera.
Note
Objects farther than this distance will be invisible to the camera.Declaration
Objective-C
@property (nonatomic) float farClip;
Swift
var farClip: Float { get set }
-
Defines the Yaw angle of the camera position relative to the target in
DEGREES
.Note
This property may be manipulated to change the camera position.Declaration
Objective-C
@property (nonatomic) float orbitalYaw;
Swift
var orbitalYaw: Float { get set }
-
Defines the Pitch angle of the camera position relative to the target in
DEGREES
.Note
This property may be manipulated to change the camera position.Declaration
Objective-C
@property (nonatomic) float orbitalPitch;
Swift
var orbitalPitch: Float { get set }
-
Defines the Radius distance of the camera to target in World Units.
Note
This property may be manipulated to change the camera position.Declaration
Objective-C
@property (nonatomic) float radius;
Swift
var radius: Float { get set }
-
Defines the Aspect Ratio of the viewport, e.g. 1.333f suggests width is 1.333 * height
Declaration
Objective-C
@property (nonatomic) float aspectRatio;
Swift
var aspectRatio: Float { get set }
-
Defines the Camera projection mode.
Possible Values;
Declaration
Objective-C
@property (nonatomic) SCICameraProjectionMode projectionMode;
Swift
var projectionMode: SCICameraProjectionMode { get set }
-
Defines the Camera Orthogonal Viewport width, used when ProjectionMode is Orthogonal.
Declaration
Objective-C
@property (nonatomic) float orthoWidth;
Swift
var orthoWidth: Float { get set }
-
Defines the Camera Orthogonal Viewport height, used when ProjectionMode is Orthogonal.
Declaration
Objective-C
@property (nonatomic) float orthoHeight;
Swift
var orthoHeight: Float { get set }
-
Defines whether or not the Camera should be zoomed to fit the parent scene bounds when it’s attached.
Declaration
Objective-C
@property (nonatomic) BOOL zoomToFitOnAttach;
Swift
var zoomToFitOnAttach: Bool { get set }
-
Defines the scale factor which is applied during calculation when Camera should be zoomed to fit the parent scene bounds.
Declaration
Objective-C
@property (nonatomic) float zoomToFitScaleFactor;
Swift
var zoomToFitScaleFactor: Float { get set }
-
Sets the Position and the Target of the Camera as XYZ
SCIVector3
in World Coordinates.Declaration
Objective-C
- (void)setPostion:(nonnull SCIVector3 *)position andTarget:(nonnull SCIVector3 *)target;
Swift
func setPostion(_ position: SCIVector3, andTarget target: SCIVector3)
Parameters
position
The new position.
target
The new target.
-
Switches the camera to Perspective mode.
Declaration
Objective-C
- (void)toPerspective;
Swift
func toPerspective()
-
Switches the camera to Orthogonal mode.
Declaration
Objective-C
- (void)toOrhtogonal;
Swift
func toOrhtogonal()
-
Calculates a Camera target and radius that will fit the bounding box completely inside the viewport.
Declaration
Objective-C
- (float)calculateRadiusAndTargetToFit:(nonnull SCIVector3 *)targetToFit;
Swift
func calculateRadiusAndTarget(toFit targetToFit: SCIVector3) -> Float
Parameters
targetToFit
The camera target to fit the bounding box completely inside the viewport.
Return Value
The radius to fit the bounding box completely inside the viewport.
-
Zooms camera to fit bounding box of parent surface inside the viewport using current camera position as reset position.
Declaration
Objective-C
- (void)zoomToFit;
Swift
func zoomToFit()
-
Zooms camera to fit bounding box of parent surface inside the viewport using current camera position as reset position.
Declaration
Objective-C
- (void)animateZoomToFitWithDuration:(NSTimeInterval)duration;
Swift
func animateZoomToFit(withDuration duration: TimeInterval)
Parameters
duration
The duration of animation when zooming to fit bounding box.
-
Zooms camera to fit bounding box of parent surface inside the viewport using specified reset position.
Declaration
Objective-C
- (void)zoomToFitWithResetPosition:(nonnull SCIVector3 *)resetPosition;
Swift
func zoomToFit(withResetPosition resetPosition: SCIVector3)
Parameters
resetPosition
The reset position to use.
-
Zooms camera to fit bounding box of parent surface inside the viewport using current camera position as reset position.
Declaration
Objective-C
- (void)animateZoomToFitWithResetPosition:(nonnull SCIVector3 *)resetPosition andDuration:(NSTimeInterval)duration;
Swift
func animateZoomToFit(withResetPosition resetPosition: SCIVector3, andDuration duration: TimeInterval)
Parameters
resetPosition
The reset position to use.
duration
The duration of animation when zooming to fit bounding box.
-
Declaration
Objective-C
- (void)animatePosition:(nonnull SCIVector3 *)position andTarget:(nonnull SCIVector3 *)target withDuration:(NSTimeInterval)duration;
Swift
func animatePosition(_ position: SCIVector3, andTarget target: SCIVector3, withDuration duration: TimeInterval)
Parameters
position
The final position of camera.
target
The final target of camera.
duration
The animation duration.
-
Sets the
ISCICameraUpdateListener
which is called when thisISCICameraController
is updated.Declaration
Objective-C
- (void)setCameraUpdateListener: (nullable id<ISCICameraUpdateListener>)cameraUpdateListener;
Swift
func setCameraUpdateListener(_ cameraUpdateListener: ISCICameraUpdateListener?)
Parameters
cameraUpdateListener
The listener to set.