Skip to content

Commit

Permalink
Update xeokit to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Nov 4, 2019
1 parent 60ec1d2 commit b6d8c73
Show file tree
Hide file tree
Showing 31 changed files with 231 additions and 615 deletions.
2 changes: 1 addition & 1 deletion lib/xeokit/plugins/AnnotationsPlugin/AnnotationsPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const tempVec3c = math.vec3();
/**
* {@link Viewer} plugin that creates {@link Annotation}s.
*
* [<img src="https://user-images.githubusercontent.com/83100/58403089-26589280-8062-11e9-8652-aed61a4e8c64.gif">](https://xeokit.github.io/xeokit-sdk/examples/#annotations_clickFlyToPosition)
* [<img src="https://user-images.githubusercontent.com/83100/58403089-26589280-8062-11e9-8652-aed61a4e8c64.gif">](https://xeokit.github.io/xeokit-sdk/examples/#annotations_clickToFlyToPosition)
*
* * [[Example 1: Create annotations with mouse](https://xeokit.github.io/xeokit-sdk/examples/#annotations_createWithMouse)]
* * [[Example 2: Click annotations to toggle labels](https://xeokit.github.io/xeokit-sdk/examples/#annotations_clickShowLabels)]
Expand Down
34 changes: 2 additions & 32 deletions lib/xeokit/plugins/NavCubePlugin/NavCubePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ import {CubeTextureCanvas} from "./CubeTextureCanvas.js";
*
* cameraFly: true, // Fly camera to each selected axis/diagonal
* cameraFitFOV: 45, // How much field-of-view the scene takes once camera has fitted it to view
* cameraFlyDuration: 0.5,// How long (in seconds) camera takes to fly to each new axis/diagonal
*
* fitVisible: false // Fit whole scene, including invisible objects (default)
* cameraFlyDuration: 0.5 // How long (in seconds) camera takes to fly to each new axis/diagonal
* });
*
* const gltfLoader = new GLTFLoaderPlugin(viewer);
Expand Down Expand Up @@ -89,8 +87,6 @@ class NavCubePlugin extends Plugin {
* @param {String} [cfg.topColor="#5555FF"] Custom color for the top face of the NavCube. Overrides ````color````.
* @param {String} [cfg.bottomColor="#5555FF"] Custom color for the bottom face of the NavCube. Overrides ````color````.
* @param {String} [cfg.hoverColor="rgba(0,0,0,0.4)"] Custom color for highlighting regions on the NavCube as we hover the pointer over them.
* @param {Boolean} [cfg.fitVisible=false] Sets whether the axis, corner and edge-aligned views will fit the
* view to the entire {@link Scene} or just to visible object-{@link Entity}s. Entitys are visible objects when {@link Entity#isObject} and {@link Entity#visible} are both ````true````.
*/
constructor(viewer, cfg = {}) {

Expand Down Expand Up @@ -446,11 +442,10 @@ class NavCubePlugin extends Plugin {
var flyTo = (function () {
var center = math.vec3();
return function (dir, up, ok) {
var aabb = self._fitVisible ? viewer.scene.getAABB(viewer.scene.visibleObjectIds) : viewer.scene.aabb;
var aabb = viewer.scene.aabb;
var diag = math.getAABB3Diag(aabb);
math.getAABB3Center(aabb, center);
var dist = Math.abs(diag / Math.tan(55.0 / 2));
viewer.cameraControl.pivotPos = center;
if (self._cameraFly) {
viewer.cameraFlight.flyTo({
look: center,
Expand Down Expand Up @@ -520,31 +515,6 @@ class NavCubePlugin extends Plugin {
return this._cubeMesh.visible;
}


/**
* Sets whether the axis, corner and edge-aligned views will fit the
* view to the entire {@link Scene} or just to visible object-{@link Entity}s.
*
* Entitys are visible objects when {@link Entity#isObject} and {@link Entity#visible} are both ````true````.
*
* @param {Boolean} fitVisible Set ````true```` to fit only visible object-Entitys.
*/
setFitVisible(fitVisible =false) {
this._fitVisible = fitVisible;
}

/**
* Gets whether the axis, corner and edge-aligned views will fit the
* view to the entire {@link Scene} or just to visible object-{@link Entity}s.
*
* Entitys are visible objects when {@link Entity#isObject} and {@link Entity#visible} are both ````true````.
*
* @return {Boolean} True when fitting only visible object-Entitys.
*/
getFitVisible() {
return this._fitVisible;
}

/**
* Sets whether the {@link Camera} flies or jumps to each selected axis or diagonal.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* @desc Property states for {@link Entity}s in {@link PlanView}s capture by a {@link PlanViewsPlugin}.
* @desc Property states for {@link Entity}s in {@link Storey}s capture by a {@link StoreyPlansPlugin}.
*
* @type {{String:Object}}
*/
const IFCPlanViewObjectStates = {
const IFCStoreyPlanObjectStates = {
IfcSlab: {
visible: true,
edges: true
Expand Down Expand Up @@ -57,4 +57,4 @@ const IFCPlanViewObjectStates = {
}
};

export {IFCPlanViewObjectStates}
export {IFCStoreyPlanObjectStates}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @desc Information about an ````IfcBuildingStorey````.
*
* These are provided by a {@link StoreyViewsPlugin}.
* These are provided by a {@link StoreyPlansPlugin}.
*/
class Storey {

Expand All @@ -11,10 +11,10 @@ class Storey {
constructor(plugin, aabb, modelId, storeyId) {

/**
* The {@link StoreyViewsPlugin} this Storey belongs to.
* The {@link StoreyPlansPlugin} this Storey belongs to.
*
* @property plugin
* @type {StoreyViewsPlugin}
* @type {StoreyPlansPlugin}
*/
this.plugin = plugin;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* @desc A 2D plan view image of an ````IfcBuildingStorey````.
*
* These are created by a {@link StoreyViewsPlugin}.
* These are created by a {@link StoreyPlansPlugin}.
*/
class StoreyMap {
class StoreyImage {

/**
* @private
Expand Down Expand Up @@ -54,4 +54,4 @@ class StoreyMap {
}
}

export {StoreyMap};
export {StoreyImage};
Loading

0 comments on commit b6d8c73

Please sign in to comment.