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: Float, y: Float, z: Float)Parameters
xoffset on x axis
yoffset on y axis
zoffset 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
yawYaw angle (degrees)
pitchPitch angle (degrees)
durationTime 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
eyeInThe new camera postion.
lookInThe new camera look vector.
upInThe new camera up vector.
animatedIf 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
eyeInThe new camera position
lookInThe new camera look vector.
upInThe new camera up vector.
animatedIf 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
objectIdObject id specified by string
HKCamera Class Reference