HKCamera
@objc
public class HKCamera : NSObject
Camera object
-
Camera position [x,y,z]
Declaration
Swift
@objc public var eye: [Double]
-
Look vector [x,y,z]
Declaration
Swift
@objc public var look: [Double]
-
Up vector [x,y,z]
Declaration
Swift
@objc public var up: [Double]
-
The current zoom factor of the camera
Declaration
Swift
@objc public var zoomFactor: Double
-
Reset camera to original position
Since
SDK 2.0Declaration
Swift
@objc public func reset()
-
Pan camera by offset in world space.
Declaration
Swift
@objc public func pan(x: Double, y: Double, z: Double)
Parameters
x
offset on x axis
y
offset on y axis
z
offset on z axis
-
Zoom the camera in and out of its point of focus.
Declaration
Swift
@objc public func zoom(_ factor: Double)
-
Orbit around camera’s current point of focus.
Declaration
Swift
@objc public func orbit(yaw: Float, pitch: Float, duration: Float = 1.0)
Parameters
yaw
Yaw angle (degrees)
pitch
Pitch angle (degrees)
duration
Time of orbit animation (seconds)
-
Move the camera, all values are optional
Declaration
Swift
@objc public func set(eyeIn: [Double]? = nil, lookIn: [Double]? = nil, upIn: [Double]? = nil, animated: Bool = true)
Parameters
eyeIn
The new camera postion.
lookIn
The new camera look vector.
upIn
The new camera up vector.
animated
If true, camera will animate from current position to new position, default is true
-
Updates camera position.
Deprecated for set()
Declaration
Swift
@available(*, deprecated, message: "Please use set(eyeIn:lookIn,upIn,animated:﹚") @objc public func updateCamera(eyeIn: [Double], lookIn: [Double], upIn: [Double], animated: Bool)
Parameters
eyeIn
The new camera position
lookIn
The new camera look vector.
upIn
The new camera up vector.
animated
If true, camera will animate from current position to new position
-
Animates camera to object specified by its id.
Declaration
Swift
@objc public func animateTo(objectId: String)
Parameters
objectId
Object id specified by string