-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #841 from mlankamp/master
Updated typings and added new types
- Loading branch information
Showing
11 changed files
with
214 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from "./PerformanceModel"; | ||
export * from "./PerformanceNode"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,17 @@ | ||
export * from "./camera"; | ||
export * from "./CameraControl/CameraControl"; | ||
export * from "./Component"; | ||
export * from "./Entity"; | ||
|
||
export * from "./camera"; | ||
export * from "./CameraControl/CameraControl"; | ||
export * from "./geometry"; | ||
export * from "./marker"; | ||
export * from "./materials"; | ||
export * from "./math/math"; | ||
export * from "./PerformanceModel/PerformanceModel"; | ||
export * from "./mementos"; | ||
export * from "./mesh"; | ||
export * from "./nodes"; | ||
export * from "./PerformanceModel"; | ||
export * from "./scene/Scene"; | ||
export * from "./sectionPlane"; | ||
export * from "./viewport"; | ||
export * from "./webgl"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,56 @@ | ||
declare const math: { | ||
unglobalizeObjectId(modelId: string, globalId: string): string; | ||
globalizeObjectId(modelId: string, objectId: string): string; | ||
|
||
/** | ||
* Returns a new, uninitialized two-element vector. | ||
* @returns {Number[]} | ||
*/ | ||
vec2: (values?: number[]) => number[]; | ||
|
||
/** | ||
* Returns a new, uninitialized three-element vector. | ||
* @returns {Number[]} | ||
*/ | ||
vec3: (values?: number[]) => number[]; | ||
|
||
/** | ||
* Returns a new, uninitialized four-element vector. | ||
* @returns {Number[]} | ||
*/ | ||
vec4: (values?: number[]) => number[]; | ||
|
||
/** | ||
* Gets the center of a 2D AABB. | ||
* @returns {Number[]} | ||
*/ | ||
getAABB2Center(aabb: number[], dest?: (values?: number[]) => number[]): number[]; | ||
|
||
/** | ||
* Gets the center of an AABB. | ||
* @returns {Number[]} | ||
*/ | ||
getAABB3Center(aabb: number[], dest?: (values?: number[]) => number[]): number[]; | ||
/** | ||
* The number of radiians in a degree (0.0174532925). | ||
*/ | ||
DEGTORAD: 0.017453292; | ||
|
||
/** | ||
* The number of degrees in a radian. | ||
*/ | ||
RADTODEG: 57.295779513; | ||
|
||
unglobalizeObjectId(modelId: string, globalId: string): string; | ||
globalizeObjectId(modelId: string, objectId: string): string; | ||
|
||
/** | ||
* Returns a new, uninitialized two-element vector. | ||
* @returns {Number[]} | ||
*/ | ||
vec2: (values?: number[]) => number[]; | ||
|
||
/** | ||
* Returns a new, uninitialized three-element vector. | ||
* @returns {Number[]} | ||
*/ | ||
vec3: (values?: number[]) => number[]; | ||
|
||
/** | ||
* Returns a new, uninitialized four-element vector. | ||
* @returns {Number[]} | ||
*/ | ||
vec4: (values?: number[]) => number[]; | ||
|
||
/** | ||
* Gets the center of a 2D AABB. | ||
* @returns {Number[]} | ||
*/ | ||
getAABB2Center(aabb: number[], dest?: (values?: number[]) => number[]): number[]; | ||
|
||
/** | ||
* Gets the center of an AABB. | ||
* @returns {Number[]} | ||
*/ | ||
getAABB3Center(aabb: number[], dest?: (values?: number[]) => number[]): number[]; | ||
|
||
/** | ||
* Gets the diagonal size of an AABB3 given as minima and maxima. | ||
*/ | ||
getAABB3Diag: (aabb: number[]) => number; | ||
|
||
/** | ||
* Normalizes a three-element vector | ||
*/ | ||
normalizeVec3: (v: number[], dest?: any) => number[]; | ||
}; | ||
|
||
export {math}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Scene } from "../scene/Scene"; | ||
|
||
/** | ||
* Saves and restores the state of a {@link Scene}'s {@link Camera}. | ||
*/ | ||
export declare class CameraMemento { | ||
/** | ||
* Creates a CameraState. | ||
* | ||
* @param {Scene} [scene] When given, immediately saves the state of the given {@link Scene}'s {@link Camera}. | ||
*/ | ||
constructor(scene?: Scene); | ||
|
||
/** | ||
* Saves the state of the given {@link Scene}'s {@link Camera}. | ||
* | ||
* @param {Scene} scene The scene that contains the {@link Camera}. | ||
*/ | ||
saveCamera(scene: Scene): void; | ||
|
||
/** | ||
* Restores a {@link Scene}'s {@link Camera} to the state previously captured with {@link CameraMemento#saveCamera}. | ||
* | ||
* @param {Scene} scene The scene. | ||
* @param {Function} [done] When this callback is given, will fly the {@link Camera} to the saved state then fire the callback. Otherwise will just jump the Camera to the saved state. | ||
*/ | ||
restoreCamera(scene: Scene, done?: ()=> void): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { Scene } from "../scene/Scene"; | ||
import { MetaModel } from '../../metadata/MetaModel'; | ||
/** | ||
* Saves and restores a snapshot of the visual state of the {@link Entity}'s of a model within a {@link Scene}. | ||
*/ | ||
export declare class ModelMemento { | ||
/** | ||
* Saves a snapshot of the visual state of the {@link Entity}'s that represent objects within a model. | ||
* | ||
* @param {Scene} scene The scene. | ||
* @param {MetaModel} metaModel Represents the model. Corresponds with an {@link Entity} that represents the model in the scene. | ||
* @param {Object} [mask] Masks what state gets saved. Saves all state when not supplied. | ||
* @param {boolean} [mask.visible] Saves {@link Entity#visible} values when ````true````. | ||
* @param {boolean} [mask.edges] Saves {@link Entity#edges} values when ````true````. | ||
* @param {boolean} [mask.xrayed] Saves {@link Entity#xrayed} values when ````true````. | ||
* @param {boolean} [mask.highlighted] Saves {@link Entity#highlighted} values when ````true````. | ||
* @param {boolean} [mask.selected] Saves {@link Entity#selected} values when ````true````. | ||
* @param {boolean} [mask.clippable] Saves {@link Entity#clippable} values when ````true````. | ||
* @param {boolean} [mask.pickable] Saves {@link Entity#pickable} values when ````true````. | ||
* @param {boolean} [mask.colorize] Saves {@link Entity#colorize} values when ````true````. | ||
* @param {boolean} [mask.opacity] Saves {@link Entity#opacity} values when ````true````. | ||
*/ | ||
saveObjects(scene: Scene, metaModel: MetaModel, mask?: { | ||
visible?: boolean; | ||
edges?: boolean; | ||
xrayed?: boolean; | ||
highlighted?: boolean; | ||
selected?: boolean; | ||
clippable?: boolean; | ||
pickable?: boolean; | ||
colorize?: boolean; | ||
opacity?: boolean; | ||
}): void; | ||
|
||
/** | ||
* Restores a {@link Scene}'s {@link Entity}'s to their state previously captured with {@link ModelMemento#saveObjects}. | ||
* | ||
* Assumes that the model has not been destroyed or modified since saving. | ||
* | ||
* @param {Scene} scene The scene that was given to {@link ModelMemento#saveObjects}. | ||
* @param {MetaModel} metaModel The metamodel that was given to {@link ModelMemento#saveObjects}. | ||
*/ | ||
restoreObjects(scene: Scene, metaModel: MetaModel): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { Scene } from "../scene/Scene"; | ||
|
||
/** | ||
* Saves and restores a snapshot of the visual state of the {@link Entity}'s that represent objects within a {@link Scene}. | ||
*/ | ||
export declare class ObjectsMemento { | ||
/** | ||
* Saves a snapshot of the visual state of the {@link Entity}'s that represent objects within a {@link Scene}. | ||
* | ||
* @param {Scene} scene The scene. | ||
* @param {Object} [mask] Masks what state gets saved. Saves all state when not supplied. | ||
* @param {boolean} [mask.visible] Saves {@link Entity#visible} values when ````true````. | ||
* @param {boolean} [mask.edges] Saves {@link Entity#edges} values when ````true````. | ||
* @param {boolean} [mask.xrayed] Saves {@link Entity#xrayed} values when ````true````. | ||
* @param {boolean} [mask.highlighted] Saves {@link Entity#highlighted} values when ````true````. | ||
* @param {boolean} [mask.selected] Saves {@link Entity#selected} values when ````true````. | ||
* @param {boolean} [mask.clippable] Saves {@link Entity#clippable} values when ````true````. | ||
* @param {boolean} [mask.pickable] Saves {@link Entity#pickable} values when ````true````. | ||
* @param {boolean} [mask.colorize] Saves {@link Entity#colorize} values when ````true````. | ||
* @param {boolean} [mask.opacity] Saves {@link Entity#opacity} values when ````true````. | ||
*/ | ||
saveObjects(scene: Scene, mask?: { | ||
visible?: boolean; | ||
edges?: boolean; | ||
xrayed?: boolean; | ||
highlighted?: boolean; | ||
selected?: boolean; | ||
clippable?: boolean; | ||
pickable?: boolean; | ||
colorize?: boolean; | ||
opacity?: boolean; | ||
}): void; | ||
|
||
/** | ||
* Restores a {@link Scene}'s {@link Entity}'s to their state previously captured with {@link ObjectsMemento#saveObjects}. | ||
* @param {Scene} scene The scene. | ||
*/ | ||
restoreObjects(scene: Scene): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from "./CameraMemento"; | ||
export * from "./ModelMemento"; | ||
export * from "./ObjectsMemento"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./Viewport"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./PickResult"; |