Move camera to a separate file.
This commit is contained in:
parent
7fc09c1ca1
commit
968f336a98
@ -1,6 +1,6 @@
|
||||
import { Coord3D } from '../geometry/coord3d.js';
|
||||
import { Color } from '../model/color.js';
|
||||
import { Camera } from '../viewer/navigation.js';
|
||||
import { Camera } from '../viewer/camera.js';
|
||||
|
||||
export let ParameterConverter =
|
||||
{
|
||||
|
||||
25
source/engine/viewer/camera.js
Normal file
25
source/engine/viewer/camera.js
Normal file
@ -0,0 +1,25 @@
|
||||
import { CoordIsEqual3D } from '../geometry/coord3d.js';
|
||||
|
||||
export class Camera
|
||||
{
|
||||
constructor (eye, center, up)
|
||||
{
|
||||
this.eye = eye;
|
||||
this.center = center;
|
||||
this.up = up;
|
||||
}
|
||||
|
||||
Clone ()
|
||||
{
|
||||
return new Camera (
|
||||
this.eye.Clone (),
|
||||
this.center.Clone (),
|
||||
this.up.Clone ()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export function CameraIsEqual3D (a, b)
|
||||
{
|
||||
return CoordIsEqual3D (a.eye, b.eye) && CoordIsEqual3D (a.center, b.center) && CoordIsEqual3D (a.up, b.up);
|
||||
}
|
||||
@ -1,33 +1,10 @@
|
||||
import { Coord2D, CoordDistance2D, SubCoord2D } from '../geometry/coord2d.js';
|
||||
import { CoordDistance3D, CoordIsEqual3D, CrossVector3D, SubCoord3D, VectorAngle3D } from '../geometry/coord3d.js';
|
||||
import { CoordDistance3D, CrossVector3D, SubCoord3D, VectorAngle3D } from '../geometry/coord3d.js';
|
||||
import { DegRad, IsGreater, IsLower, IsZero } from '../geometry/geometry.js';
|
||||
import { ParabolicTweenFunction, TweenCoord3D } from '../geometry/tween.js';
|
||||
import { CameraIsEqual3D } from './camera.js';
|
||||
import { GetDomElementClientCoordinates } from './domutils.js';
|
||||
|
||||
export class Camera
|
||||
{
|
||||
constructor (eye, center, up)
|
||||
{
|
||||
this.eye = eye;
|
||||
this.center = center;
|
||||
this.up = up;
|
||||
}
|
||||
|
||||
Clone ()
|
||||
{
|
||||
return new Camera (
|
||||
this.eye.Clone (),
|
||||
this.center.Clone (),
|
||||
this.up.Clone ()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export function CameraIsEqual3D (a, b)
|
||||
{
|
||||
return CoordIsEqual3D (a.eye, b.eye) && CoordIsEqual3D (a.center, b.center) && CoordIsEqual3D (a.up, b.up);
|
||||
}
|
||||
|
||||
export class MouseInteraction
|
||||
{
|
||||
constructor ()
|
||||
|
||||
@ -2,8 +2,9 @@ import { Coord3D, CoordDistance3D, SubCoord3D } from '../geometry/coord3d.js';
|
||||
import { Direction } from '../geometry/geometry.js';
|
||||
import { ColorToHexString } from '../model/color.js';
|
||||
import { ShadingType } from '../threejs/threeutils.js';
|
||||
import { Camera } from './camera.js';
|
||||
import { GetDomElementInnerDimensions } from './domutils.js';
|
||||
import { Camera, Navigation } from './navigation.js';
|
||||
import { Navigation } from './navigation.js';
|
||||
import { ViewerExtraGeometry, ViewerGeometry } from './viewergeometry.js';
|
||||
|
||||
export function GetDefaultCamera (direction)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user