UNPKG

nanogl-gltf

Version:
47 lines (46 loc) 1.71 kB
import Gltf2 from '../types/Gltf2'; import GltfLoader from '../io/GltfLoader'; import GltfTypes from '../types/GltfTypes'; import { IElement } from '../types/Elements'; import { ICameraLens } from 'nanogl-camera/ICameraLens'; import OrthographicLens from 'nanogl-camera/ortho-lens'; /** * Either a Perspective or Orthographic projection data */ export declare type ProjectionData = Gltf2.ICameraPerspective | Gltf2.ICameraOrthographic; /** * The Camera element only contains a perspective or orthographic lens object, used to render the scene. */ export default class Camera implements IElement { readonly gltftype: GltfTypes.CAMERA; name: undefined | string; extras: any; /** * Type of the camera, either perspective or orthographic */ type: Gltf2.CameraType; /** * Either a Perspective or Orthographic projection data */ projectionData: ProjectionData; /** * nanogl-camera lens object, either a PerspectiveLens or OrthographicLens */ lens: ICameraLens; /** * Parse the Camera data, create the nanogl-camera lens object * @param gltfLoader GLTFLoader to use, unused here * @param data Data to parse */ parse(gltfLoader: GltfLoader, data: Gltf2.ICamera): Promise<any>; /** * Create a PerspectiveLens from the glTF data * @param data Data coming from the glTF file, containing the perspective data */ createPerpective(data: Gltf2.ICameraPerspective): ICameraLens; /** * Create an OrthographicLens from the glTF data * @param data Data coming from the glTF file, containing the orthographic data */ createOrtho(data: Gltf2.ICameraOrthographic): OrthographicLens; }