@gov.nasa.jpl.honeycomb/camera-loader
v0.0.6
Published
Loader and parser for CameraModel files using the built in XML parser.
Downloads
2
Readme
CameraModel Loader
Loader and parser for CameraModel files using the built in XML parser.
Use
Loading Camera Models from an url
import { CameraLoader } from 'camera-loader';
const loader = new CameraLoader();
const cameras = loader
.load( '../path/to/file.xml' )
.then( result => {
// Camera models here!
} );Parsing Camera Models from a string
import { CameraLoader } from 'camera-loader';
const loader = new CameraLoader();
const cameraModels = loader.parse( xmlString );API
CameraDefinition
type
type : 'CAHVORE' | 'CAHVOR' | 'CAHV'The type of camera model.
name
name : StringThe name of the camera model.
frameName
frameName : StringThe frame name that a the camera model is dfined relative to.
width
width : NumberThe width in pixels
height
height : NumberThe height in pixels
minRange
minRange : NumberpupilType
pupilType : Numberlinearity
linearity : NumberCameraLoaderBase
Class for loading and parsing RSVP XML Camera model files
fetchOptions
fetchOptions : Object = { credentials: 'same-origin' }Fetch options for loading the file.
load
load( url : String ) : Promise<Object<String, CameraDefinition>>Loads and parses the XML file. The promise resolves with the returned data from the parse function.
parse
parse( str : String ) : Object<String, CameraDefinition>Parses the contents of the given Camera XML and returns an object describing the models.
CameraLoader
CameraLoaderBase implementation that sets the C, C_LOCAL, A, H, V, O, and R fields to use THREE.Vector3 instances rather than arrays.
extends CameraLoaderBase
