HKCamera
@objc
public class HKCamera : NSObject
Camera object
-
Eye vector [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 zoom: Double
-
Get current Module’s initial camera information. (eye, look, and up) Queries the scene asynchronously and sets local variables in the Camera object
Declaration
Swift
@objc public func getModuleCameraInfo(moduleID: String)
-
Get current Chapter’s initial camera information. (eye, look, and up) Queries the scene asynchronously and sets local variables in the Camera object
Declaration
Swift
@objc public func getChapterCameraInfo()
-
Get current camera information. (eye, look, up, and zoom) Queries the scene asynchronously and sets local variables in the Camera object
Declaration
Swift
@objc public func getCameraInfo()
-
Pan camera by offset in world space.
Declaration
Swift
@objc public func pan(x: Float, y: Float, z: Float)
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: Float)
Parameters
factor
Zoom factor between 0 and 1
-
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)
-
Updates camera position.
Declaration
Swift
@objc public func updateCamera(eyeIn: [Double], lookIn: [Double], upIn: [Double], animated: Bool)
Parameters
eyeIn
The new camera eye vector.
lookIn
The new camera look vector.
upIn
The new camera up vector.
animated
If true, camera will animate from current position to new position
-
Lock or unlock the camera rotation around the Y axis
Declaration
Swift
@objc public func lockCamera(lock: Bool)
Parameters
lock
boolean
-
Animates camera to object specified by its id.
Declaration
Swift
@objc public func animateTo(objectId: String)
Parameters
objectId
Object id specified by string