@mlightcad/three-viewcube
Version:
A highly customizable standalone view cube addon for three.js
71 lines • 2.07 kB
TypeScript
import * as THREE from 'three';
import { FaceNames } from './faceNames';
import { FixedPosGizmo, ObjectPosition } from './fixedPosGizmo';
/**
* Options to customize view cube
*/
export interface ViewCubeOptions {
/**
* Position of view cube
*/
pos?: ObjectPosition;
/**
* Size of area ocupied by view cube. Because width and height of this area is same, it is single value.
* The real size of view cube will be calculated automatically considering rotation.
*/
dimension?: number;
/**
* Face color of view cube
*/
faceColor?: number;
/**
* Color when hovering on face, edge, and corner of view cube
*/
hoverColor?: number;
/**
* Edge color of view cube
*/
outlineColor?: number;
/**
* Text in each face of view cube
*/
faceNames?: FaceNames;
/**
* Font size of the faceNames
*/
fontSize?: number;
}
/**
* Default view cube option values
*/
export declare const DEFAULT_VIEWCUBE_OPTIONS: ViewCubeOptions;
export interface ViewCubeEvent extends THREE.Object3DEventMap {
change: {
quaternion: THREE.Quaternion;
};
}
/**
* A highly customizable standalone view cube gizmo for three.js.
*/
export declare class ViewCubeGizmo extends FixedPosGizmo<ViewCubeEvent> {
private cube;
/**
* Construct one instance of view cube gizmo
* @param camera Camera used in your canvas
* @param renderer Renderer used in your canvas
* @param options Options to customize view cube gizmo
*/
constructor(camera: THREE.PerspectiveCamera | THREE.OrthographicCamera, renderer: THREE.WebGLRenderer, options?: ViewCubeOptions);
/**
* Free the GPU-related resources allocated by this instance. Call this method whenever this instance
* is no longer used in your app.
*/
dispose(): void;
private listen;
private handleMouseClick;
private handleMouseMove;
private checkSideTouch;
private checkSideOver;
private getRotation;
}
//# sourceMappingURL=viewCubeGizmo.d.ts.map