|
@@ -3442,6 +3442,13 @@ var BABYLON;
|
|
return new Vector3(0.0, 0.0, 1.0);
|
|
return new Vector3(0.0, 0.0, 1.0);
|
|
};
|
|
};
|
|
/**
|
|
/**
|
|
|
|
+ * Returns a new Vector3 set to (0.0, 0.0, -1.0)
|
|
|
|
+ * @returns a new forward Vector3
|
|
|
|
+ */
|
|
|
|
+ Vector3.Backward = function () {
|
|
|
|
+ return new Vector3(0.0, 0.0, -1.0);
|
|
|
|
+ };
|
|
|
|
+ /**
|
|
* Returns a new Vector3 set to (1.0, 0.0, 0.0)
|
|
* Returns a new Vector3 set to (1.0, 0.0, 0.0)
|
|
* @returns a new right Vector3
|
|
* @returns a new right Vector3
|
|
*/
|
|
*/
|
|
@@ -7034,11 +7041,23 @@ var BABYLON;
|
|
return Angle;
|
|
return Angle;
|
|
}());
|
|
}());
|
|
BABYLON.Angle = Angle;
|
|
BABYLON.Angle = Angle;
|
|
|
|
+ /**
|
|
|
|
+ * This represents an arc in a 2d space.
|
|
|
|
+ */
|
|
var Arc2 = /** @class */ (function () {
|
|
var Arc2 = /** @class */ (function () {
|
|
/**
|
|
/**
|
|
* Creates an Arc object from the three given points : start, middle and end.
|
|
* Creates an Arc object from the three given points : start, middle and end.
|
|
- */
|
|
|
|
- function Arc2(startPoint, midPoint, endPoint) {
|
|
|
|
|
|
+ * @param startPoint Defines the start point of the arc
|
|
|
|
+ * @param midPoint Defines the midlle point of the arc
|
|
|
|
+ * @param endPoint Defines the end point of the arc
|
|
|
|
+ */
|
|
|
|
+ function Arc2(
|
|
|
|
+ /** Defines the start point of the arc */
|
|
|
|
+ startPoint,
|
|
|
|
+ /** Defines the mid point of the arc */
|
|
|
|
+ midPoint,
|
|
|
|
+ /** Defines the end point of the arc */
|
|
|
|
+ endPoint) {
|
|
this.startPoint = startPoint;
|
|
this.startPoint = startPoint;
|
|
this.midPoint = midPoint;
|
|
this.midPoint = midPoint;
|
|
this.endPoint = endPoint;
|
|
this.endPoint = endPoint;
|
|
@@ -17686,7 +17705,7 @@ var BABYLON;
|
|
this._parentRenderId = -1;
|
|
this._parentRenderId = -1;
|
|
this._childRenderId = -1;
|
|
this._childRenderId = -1;
|
|
/** @hidden */
|
|
/** @hidden */
|
|
- this._worldMatrix = BABYLON.Matrix.Zero();
|
|
|
|
|
|
+ this._worldMatrix = BABYLON.Matrix.Identity();
|
|
/** @hidden */
|
|
/** @hidden */
|
|
this._worldMatrixDeterminant = 0;
|
|
this._worldMatrixDeterminant = 0;
|
|
this._animationPropertiesOverride = null;
|
|
this._animationPropertiesOverride = null;
|
|
@@ -47591,36 +47610,135 @@ var BABYLON;
|
|
BABYLON.Node.AddNodeConstructor("ArcRotateCamera", function (name, scene) {
|
|
BABYLON.Node.AddNodeConstructor("ArcRotateCamera", function (name, scene) {
|
|
return function () { return new ArcRotateCamera(name, 0, 0, 1.0, BABYLON.Vector3.Zero(), scene); };
|
|
return function () { return new ArcRotateCamera(name, 0, 0, 1.0, BABYLON.Vector3.Zero(), scene); };
|
|
});
|
|
});
|
|
|
|
+ /**
|
|
|
|
+ * This represents an orbital type of camera.
|
|
|
|
+ *
|
|
|
|
+ * This camera always points towards a given target position and can be rotated around that target with the target as the centre of rotation. It can be controlled with cursors and mouse, or with touch events.
|
|
|
|
+ * Think of this camera as one orbiting its target position, or more imaginatively as a spy satellite orbiting the earth. Its position relative to the target (earth) can be set by three parameters, alpha (radians) the longitudinal rotation, beta (radians) the latitudinal rotation and radius the distance from the target position.
|
|
|
|
+ * @see http://doc.babylonjs.com/babylon101/cameras#arc-rotate-camera
|
|
|
|
+ */
|
|
var ArcRotateCamera = /** @class */ (function (_super) {
|
|
var ArcRotateCamera = /** @class */ (function (_super) {
|
|
__extends(ArcRotateCamera, _super);
|
|
__extends(ArcRotateCamera, _super);
|
|
|
|
+ /**
|
|
|
|
+ * Instantiates a new ArcRotateCamera in a given scene
|
|
|
|
+ * @param name Defines the name of the camera
|
|
|
|
+ * @param alpha Defines the camera rotation along the logitudinal axis
|
|
|
|
+ * @param beta Defines the camera rotation along the latitudinal axis
|
|
|
|
+ * @param radius Defines the camera distance from its target
|
|
|
|
+ * @param target Defines the camera target
|
|
|
|
+ * @param scene Defines the scene the camera belongs to
|
|
|
|
+ * @param setActiveOnSceneIfNoneActive Defines wheter the camera should be marked as active if not other active cameras have been defined
|
|
|
|
+ */
|
|
function ArcRotateCamera(name, alpha, beta, radius, target, scene, setActiveOnSceneIfNoneActive) {
|
|
function ArcRotateCamera(name, alpha, beta, radius, target, scene, setActiveOnSceneIfNoneActive) {
|
|
if (setActiveOnSceneIfNoneActive === void 0) { setActiveOnSceneIfNoneActive = true; }
|
|
if (setActiveOnSceneIfNoneActive === void 0) { setActiveOnSceneIfNoneActive = true; }
|
|
var _this = _super.call(this, name, BABYLON.Vector3.Zero(), scene, setActiveOnSceneIfNoneActive) || this;
|
|
var _this = _super.call(this, name, BABYLON.Vector3.Zero(), scene, setActiveOnSceneIfNoneActive) || this;
|
|
|
|
+ /**
|
|
|
|
+ * Current inertia value on the longitudinal axis.
|
|
|
|
+ * The bigger this number the longer it will take for the camera to stop.
|
|
|
|
+ */
|
|
_this.inertialAlphaOffset = 0;
|
|
_this.inertialAlphaOffset = 0;
|
|
|
|
+ /**
|
|
|
|
+ * Current inertia value on the latitudinal axis.
|
|
|
|
+ * The bigger this number the longer it will take for the camera to stop.
|
|
|
|
+ */
|
|
_this.inertialBetaOffset = 0;
|
|
_this.inertialBetaOffset = 0;
|
|
|
|
+ /**
|
|
|
|
+ * Current inertia value on the radius axis.
|
|
|
|
+ * The bigger this number the longer it will take for the camera to stop.
|
|
|
|
+ */
|
|
_this.inertialRadiusOffset = 0;
|
|
_this.inertialRadiusOffset = 0;
|
|
|
|
+ /**
|
|
|
|
+ * Minimum allowed angle on the longitudinal axis.
|
|
|
|
+ * This can help limiting how the Camera is able to move in the scene.
|
|
|
|
+ */
|
|
_this.lowerAlphaLimit = null;
|
|
_this.lowerAlphaLimit = null;
|
|
|
|
+ /**
|
|
|
|
+ * Maximum allowed angle on the longitudinal axis.
|
|
|
|
+ * This can help limiting how the Camera is able to move in the scene.
|
|
|
|
+ */
|
|
_this.upperAlphaLimit = null;
|
|
_this.upperAlphaLimit = null;
|
|
|
|
+ /**
|
|
|
|
+ * Minimum allowed angle on the latitudinal axis.
|
|
|
|
+ * This can help limiting how the Camera is able to move in the scene.
|
|
|
|
+ */
|
|
_this.lowerBetaLimit = 0.01;
|
|
_this.lowerBetaLimit = 0.01;
|
|
|
|
+ /**
|
|
|
|
+ * Maximum allowed angle on the latitudinal axis.
|
|
|
|
+ * This can help limiting how the Camera is able to move in the scene.
|
|
|
|
+ */
|
|
_this.upperBetaLimit = Math.PI;
|
|
_this.upperBetaLimit = Math.PI;
|
|
|
|
+ /**
|
|
|
|
+ * Minimum allowed distance of the camera to the target (The camera can not get closer).
|
|
|
|
+ * This can help limiting how the Camera is able to move in the scene.
|
|
|
|
+ */
|
|
_this.lowerRadiusLimit = null;
|
|
_this.lowerRadiusLimit = null;
|
|
|
|
+ /**
|
|
|
|
+ * Maximum allowed distance of the camera to the target (The camera can not get further).
|
|
|
|
+ * This can help limiting how the Camera is able to move in the scene.
|
|
|
|
+ */
|
|
_this.upperRadiusLimit = null;
|
|
_this.upperRadiusLimit = null;
|
|
|
|
+ /**
|
|
|
|
+ * Defines the current inertia value used during panning of the camera along the X axis.
|
|
|
|
+ */
|
|
_this.inertialPanningX = 0;
|
|
_this.inertialPanningX = 0;
|
|
|
|
+ /**
|
|
|
|
+ * Defines the current inertia value used during panning of the camera along the Y axis.
|
|
|
|
+ */
|
|
_this.inertialPanningY = 0;
|
|
_this.inertialPanningY = 0;
|
|
|
|
+ /**
|
|
|
|
+ * Defines the distance used to consider the camera in pan mode vs pinch/zoom.
|
|
|
|
+ * Basically if your fingers moves away from more than this distance you will be considered
|
|
|
|
+ * in pinch mode.
|
|
|
|
+ */
|
|
_this.pinchToPanMaxDistance = 20;
|
|
_this.pinchToPanMaxDistance = 20;
|
|
|
|
+ /**
|
|
|
|
+ * Defines the maximum distance the camera can pan.
|
|
|
|
+ * This could help keeping the cammera always in your scene.
|
|
|
|
+ */
|
|
_this.panningDistanceLimit = null;
|
|
_this.panningDistanceLimit = null;
|
|
|
|
+ /**
|
|
|
|
+ * Defines the target of the camera before paning.
|
|
|
|
+ */
|
|
_this.panningOriginTarget = BABYLON.Vector3.Zero();
|
|
_this.panningOriginTarget = BABYLON.Vector3.Zero();
|
|
|
|
+ /**
|
|
|
|
+ * Defines the value of the inertia used during panning.
|
|
|
|
+ * 0 would mean stop inertia and one would mean no decelleration at all.
|
|
|
|
+ */
|
|
_this.panningInertia = 0.9;
|
|
_this.panningInertia = 0.9;
|
|
//-- end properties for backward compatibility for inputs
|
|
//-- end properties for backward compatibility for inputs
|
|
|
|
+ /**
|
|
|
|
+ * Defines how much the radius should be scaled while zomming on a particular mesh (through the zoomOn function)
|
|
|
|
+ */
|
|
_this.zoomOnFactor = 1;
|
|
_this.zoomOnFactor = 1;
|
|
|
|
+ /**
|
|
|
|
+ * Defines a screen offset for the camera position.
|
|
|
|
+ */
|
|
_this.targetScreenOffset = BABYLON.Vector2.Zero();
|
|
_this.targetScreenOffset = BABYLON.Vector2.Zero();
|
|
|
|
+ /**
|
|
|
|
+ * Allows the camera to be completely reversed.
|
|
|
|
+ * If false the camera can not arrive upside down.
|
|
|
|
+ */
|
|
_this.allowUpsideDown = true;
|
|
_this.allowUpsideDown = true;
|
|
/** @hidden */
|
|
/** @hidden */
|
|
_this._viewMatrix = new BABYLON.Matrix();
|
|
_this._viewMatrix = new BABYLON.Matrix();
|
|
- // Panning
|
|
|
|
|
|
+ /**
|
|
|
|
+ * Defines the allowed panning axis.
|
|
|
|
+ */
|
|
_this.panningAxis = new BABYLON.Vector3(1, 1, 0);
|
|
_this.panningAxis = new BABYLON.Vector3(1, 1, 0);
|
|
|
|
+ /**
|
|
|
|
+ * Observable triggered when the mesh target has been changed on the camera.
|
|
|
|
+ */
|
|
_this.onMeshTargetChangedObservable = new BABYLON.Observable();
|
|
_this.onMeshTargetChangedObservable = new BABYLON.Observable();
|
|
|
|
+ /**
|
|
|
|
+ * Defines whether the camera should check collision with the objects oh the scene.
|
|
|
|
+ * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity#how-can-i-do-this
|
|
|
|
+ */
|
|
_this.checkCollisions = false;
|
|
_this.checkCollisions = false;
|
|
|
|
+ /**
|
|
|
|
+ * Defines the collision radius of the camera.
|
|
|
|
+ * This simulates a sphere around the camera.
|
|
|
|
+ * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity#arcrotatecamera
|
|
|
|
+ */
|
|
_this.collisionRadius = new BABYLON.Vector3(0.5, 0.5, 0.5);
|
|
_this.collisionRadius = new BABYLON.Vector3(0.5, 0.5, 0.5);
|
|
_this._previousPosition = BABYLON.Vector3.Zero();
|
|
_this._previousPosition = BABYLON.Vector3.Zero();
|
|
_this._collisionVelocity = BABYLON.Vector3.Zero();
|
|
_this._collisionVelocity = BABYLON.Vector3.Zero();
|
|
@@ -47675,6 +47793,10 @@ var BABYLON;
|
|
return _this;
|
|
return _this;
|
|
}
|
|
}
|
|
Object.defineProperty(ArcRotateCamera.prototype, "target", {
|
|
Object.defineProperty(ArcRotateCamera.prototype, "target", {
|
|
|
|
+ /**
|
|
|
|
+ * Defines the target point of the camera.
|
|
|
|
+ * The camera looks towards it form the radius distance.
|
|
|
|
+ */
|
|
get: function () {
|
|
get: function () {
|
|
return this._target;
|
|
return this._target;
|
|
},
|
|
},
|
|
@@ -47686,6 +47808,9 @@ var BABYLON;
|
|
});
|
|
});
|
|
Object.defineProperty(ArcRotateCamera.prototype, "angularSensibilityX", {
|
|
Object.defineProperty(ArcRotateCamera.prototype, "angularSensibilityX", {
|
|
//-- begin properties for backward compatibility for inputs
|
|
//-- begin properties for backward compatibility for inputs
|
|
|
|
+ /**
|
|
|
|
+ * Gets or Set the pointer angular sensibility along the X axis or how fast is the camera rotating.
|
|
|
|
+ */
|
|
get: function () {
|
|
get: function () {
|
|
var pointers = this.inputs.attached["pointers"];
|
|
var pointers = this.inputs.attached["pointers"];
|
|
if (pointers)
|
|
if (pointers)
|
|
@@ -47702,6 +47827,9 @@ var BABYLON;
|
|
configurable: true
|
|
configurable: true
|
|
});
|
|
});
|
|
Object.defineProperty(ArcRotateCamera.prototype, "angularSensibilityY", {
|
|
Object.defineProperty(ArcRotateCamera.prototype, "angularSensibilityY", {
|
|
|
|
+ /**
|
|
|
|
+ * Gets or Set the pointer angular sensibility along the Y axis or how fast is the camera rotating.
|
|
|
|
+ */
|
|
get: function () {
|
|
get: function () {
|
|
var pointers = this.inputs.attached["pointers"];
|
|
var pointers = this.inputs.attached["pointers"];
|
|
if (pointers)
|
|
if (pointers)
|
|
@@ -47718,6 +47846,9 @@ var BABYLON;
|
|
configurable: true
|
|
configurable: true
|
|
});
|
|
});
|
|
Object.defineProperty(ArcRotateCamera.prototype, "pinchPrecision", {
|
|
Object.defineProperty(ArcRotateCamera.prototype, "pinchPrecision", {
|
|
|
|
+ /**
|
|
|
|
+ * Gets or Set the pointer pinch precision or how fast is the camera zooming.
|
|
|
|
+ */
|
|
get: function () {
|
|
get: function () {
|
|
var pointers = this.inputs.attached["pointers"];
|
|
var pointers = this.inputs.attached["pointers"];
|
|
if (pointers)
|
|
if (pointers)
|
|
@@ -47734,6 +47865,11 @@ var BABYLON;
|
|
configurable: true
|
|
configurable: true
|
|
});
|
|
});
|
|
Object.defineProperty(ArcRotateCamera.prototype, "pinchDeltaPercentage", {
|
|
Object.defineProperty(ArcRotateCamera.prototype, "pinchDeltaPercentage", {
|
|
|
|
+ /**
|
|
|
|
+ * Gets or Set the pointer pinch delta percentage or how fast is the camera zooming.
|
|
|
|
+ * It will be used instead of pinchDeltaPrecision if different from 0.
|
|
|
|
+ * It defines the percentage of current camera.radius to use as delta when pinch zoom is used.
|
|
|
|
+ */
|
|
get: function () {
|
|
get: function () {
|
|
var pointers = this.inputs.attached["pointers"];
|
|
var pointers = this.inputs.attached["pointers"];
|
|
if (pointers)
|
|
if (pointers)
|
|
@@ -47750,6 +47886,9 @@ var BABYLON;
|
|
configurable: true
|
|
configurable: true
|
|
});
|
|
});
|
|
Object.defineProperty(ArcRotateCamera.prototype, "panningSensibility", {
|
|
Object.defineProperty(ArcRotateCamera.prototype, "panningSensibility", {
|
|
|
|
+ /**
|
|
|
|
+ * Gets or Set the pointer panning sensibility or how fast is the camera moving.
|
|
|
|
+ */
|
|
get: function () {
|
|
get: function () {
|
|
var pointers = this.inputs.attached["pointers"];
|
|
var pointers = this.inputs.attached["pointers"];
|
|
if (pointers)
|
|
if (pointers)
|
|
@@ -47766,6 +47905,9 @@ var BABYLON;
|
|
configurable: true
|
|
configurable: true
|
|
});
|
|
});
|
|
Object.defineProperty(ArcRotateCamera.prototype, "keysUp", {
|
|
Object.defineProperty(ArcRotateCamera.prototype, "keysUp", {
|
|
|
|
+ /**
|
|
|
|
+ * Gets or Set the list of keyboard keys used to control beta angle in a positive direction.
|
|
|
|
+ */
|
|
get: function () {
|
|
get: function () {
|
|
var keyboard = this.inputs.attached["keyboard"];
|
|
var keyboard = this.inputs.attached["keyboard"];
|
|
if (keyboard)
|
|
if (keyboard)
|
|
@@ -47781,6 +47923,9 @@ var BABYLON;
|
|
configurable: true
|
|
configurable: true
|
|
});
|
|
});
|
|
Object.defineProperty(ArcRotateCamera.prototype, "keysDown", {
|
|
Object.defineProperty(ArcRotateCamera.prototype, "keysDown", {
|
|
|
|
+ /**
|
|
|
|
+ * Gets or Set the list of keyboard keys used to control beta angle in a negative direction.
|
|
|
|
+ */
|
|
get: function () {
|
|
get: function () {
|
|
var keyboard = this.inputs.attached["keyboard"];
|
|
var keyboard = this.inputs.attached["keyboard"];
|
|
if (keyboard)
|
|
if (keyboard)
|
|
@@ -47796,6 +47941,9 @@ var BABYLON;
|
|
configurable: true
|
|
configurable: true
|
|
});
|
|
});
|
|
Object.defineProperty(ArcRotateCamera.prototype, "keysLeft", {
|
|
Object.defineProperty(ArcRotateCamera.prototype, "keysLeft", {
|
|
|
|
+ /**
|
|
|
|
+ * Gets or Set the list of keyboard keys used to control alpha angle in a negative direction.
|
|
|
|
+ */
|
|
get: function () {
|
|
get: function () {
|
|
var keyboard = this.inputs.attached["keyboard"];
|
|
var keyboard = this.inputs.attached["keyboard"];
|
|
if (keyboard)
|
|
if (keyboard)
|
|
@@ -47811,6 +47959,9 @@ var BABYLON;
|
|
configurable: true
|
|
configurable: true
|
|
});
|
|
});
|
|
Object.defineProperty(ArcRotateCamera.prototype, "keysRight", {
|
|
Object.defineProperty(ArcRotateCamera.prototype, "keysRight", {
|
|
|
|
+ /**
|
|
|
|
+ * Gets or Set the list of keyboard keys used to control alpha angle in a positive direction.
|
|
|
|
+ */
|
|
get: function () {
|
|
get: function () {
|
|
var keyboard = this.inputs.attached["keyboard"];
|
|
var keyboard = this.inputs.attached["keyboard"];
|
|
if (keyboard)
|
|
if (keyboard)
|
|
@@ -47826,6 +47977,9 @@ var BABYLON;
|
|
configurable: true
|
|
configurable: true
|
|
});
|
|
});
|
|
Object.defineProperty(ArcRotateCamera.prototype, "wheelPrecision", {
|
|
Object.defineProperty(ArcRotateCamera.prototype, "wheelPrecision", {
|
|
|
|
+ /**
|
|
|
|
+ * Gets or Set the mouse wheel precision or how fast is the camera zooming.
|
|
|
|
+ */
|
|
get: function () {
|
|
get: function () {
|
|
var mousewheel = this.inputs.attached["mousewheel"];
|
|
var mousewheel = this.inputs.attached["mousewheel"];
|
|
if (mousewheel)
|
|
if (mousewheel)
|
|
@@ -47841,6 +47995,11 @@ var BABYLON;
|
|
configurable: true
|
|
configurable: true
|
|
});
|
|
});
|
|
Object.defineProperty(ArcRotateCamera.prototype, "wheelDeltaPercentage", {
|
|
Object.defineProperty(ArcRotateCamera.prototype, "wheelDeltaPercentage", {
|
|
|
|
+ /**
|
|
|
|
+ * Gets or Set the mouse wheel delta percentage or how fast is the camera zooming.
|
|
|
|
+ * It will be used instead of pinchDeltaPrecision if different from 0.
|
|
|
|
+ * It defines the percentage of current camera.radius to use as delta when pinch zoom is used.
|
|
|
|
+ */
|
|
get: function () {
|
|
get: function () {
|
|
var mousewheel = this.inputs.attached["mousewheel"];
|
|
var mousewheel = this.inputs.attached["mousewheel"];
|
|
if (mousewheel)
|
|
if (mousewheel)
|
|
@@ -47856,6 +48015,10 @@ var BABYLON;
|
|
configurable: true
|
|
configurable: true
|
|
});
|
|
});
|
|
Object.defineProperty(ArcRotateCamera.prototype, "bouncingBehavior", {
|
|
Object.defineProperty(ArcRotateCamera.prototype, "bouncingBehavior", {
|
|
|
|
+ /**
|
|
|
|
+ * Gets the bouncing behavior of the camera if it has been enabled.
|
|
|
|
+ * @see http://doc.babylonjs.com/how_to/camera_behaviors#bouncing-behavior
|
|
|
|
+ */
|
|
get: function () {
|
|
get: function () {
|
|
return this._bouncingBehavior;
|
|
return this._bouncingBehavior;
|
|
},
|
|
},
|
|
@@ -47863,6 +48026,10 @@ var BABYLON;
|
|
configurable: true
|
|
configurable: true
|
|
});
|
|
});
|
|
Object.defineProperty(ArcRotateCamera.prototype, "useBouncingBehavior", {
|
|
Object.defineProperty(ArcRotateCamera.prototype, "useBouncingBehavior", {
|
|
|
|
+ /**
|
|
|
|
+ * Defines if the bouncing behavior of the camera is enabled on the camera.
|
|
|
|
+ * @see http://doc.babylonjs.com/how_to/camera_behaviors#bouncing-behavior
|
|
|
|
+ */
|
|
get: function () {
|
|
get: function () {
|
|
return this._bouncingBehavior != null;
|
|
return this._bouncingBehavior != null;
|
|
},
|
|
},
|
|
@@ -47883,6 +48050,10 @@ var BABYLON;
|
|
configurable: true
|
|
configurable: true
|
|
});
|
|
});
|
|
Object.defineProperty(ArcRotateCamera.prototype, "framingBehavior", {
|
|
Object.defineProperty(ArcRotateCamera.prototype, "framingBehavior", {
|
|
|
|
+ /**
|
|
|
|
+ * Gets the framing behavior of the camera if it has been enabled.
|
|
|
|
+ * @see http://doc.babylonjs.com/how_to/camera_behaviors#framing-behavior
|
|
|
|
+ */
|
|
get: function () {
|
|
get: function () {
|
|
return this._framingBehavior;
|
|
return this._framingBehavior;
|
|
},
|
|
},
|
|
@@ -47890,6 +48061,10 @@ var BABYLON;
|
|
configurable: true
|
|
configurable: true
|
|
});
|
|
});
|
|
Object.defineProperty(ArcRotateCamera.prototype, "useFramingBehavior", {
|
|
Object.defineProperty(ArcRotateCamera.prototype, "useFramingBehavior", {
|
|
|
|
+ /**
|
|
|
|
+ * Defines if the framing behavior of the camera is enabled on the camera.
|
|
|
|
+ * @see http://doc.babylonjs.com/how_to/camera_behaviors#framing-behavior
|
|
|
|
+ */
|
|
get: function () {
|
|
get: function () {
|
|
return this._framingBehavior != null;
|
|
return this._framingBehavior != null;
|
|
},
|
|
},
|
|
@@ -47910,6 +48085,10 @@ var BABYLON;
|
|
configurable: true
|
|
configurable: true
|
|
});
|
|
});
|
|
Object.defineProperty(ArcRotateCamera.prototype, "autoRotationBehavior", {
|
|
Object.defineProperty(ArcRotateCamera.prototype, "autoRotationBehavior", {
|
|
|
|
+ /**
|
|
|
|
+ * Gets the auto rotation behavior of the camera if it has been enabled.
|
|
|
|
+ * @see http://doc.babylonjs.com/how_to/camera_behaviors#autorotation-behavior
|
|
|
|
+ */
|
|
get: function () {
|
|
get: function () {
|
|
return this._autoRotationBehavior;
|
|
return this._autoRotationBehavior;
|
|
},
|
|
},
|
|
@@ -47917,6 +48096,10 @@ var BABYLON;
|
|
configurable: true
|
|
configurable: true
|
|
});
|
|
});
|
|
Object.defineProperty(ArcRotateCamera.prototype, "useAutoRotationBehavior", {
|
|
Object.defineProperty(ArcRotateCamera.prototype, "useAutoRotationBehavior", {
|
|
|
|
+ /**
|
|
|
|
+ * Defines if the auto rotation behavior of the camera is enabled on the camera.
|
|
|
|
+ * @see http://doc.babylonjs.com/how_to/camera_behaviors#autorotation-behavior
|
|
|
|
+ */
|
|
get: function () {
|
|
get: function () {
|
|
return this._autoRotationBehavior != null;
|
|
return this._autoRotationBehavior != null;
|
|
},
|
|
},
|
|
@@ -47973,6 +48156,10 @@ var BABYLON;
|
|
}
|
|
}
|
|
return this._target;
|
|
return this._target;
|
|
};
|
|
};
|
|
|
|
+ /**
|
|
|
|
+ * Stores the current state of the camera (alpha, beta, radius and target)
|
|
|
|
+ * @returns the camera itself
|
|
|
|
+ */
|
|
ArcRotateCamera.prototype.storeState = function () {
|
|
ArcRotateCamera.prototype.storeState = function () {
|
|
this._storedAlpha = this.alpha;
|
|
this._storedAlpha = this.alpha;
|
|
this._storedBeta = this.beta;
|
|
this._storedBeta = this.beta;
|
|
@@ -48010,7 +48197,13 @@ var BABYLON;
|
|
&& this._cache.radius === this.radius
|
|
&& this._cache.radius === this.radius
|
|
&& this._cache.targetScreenOffset.equals(this.targetScreenOffset);
|
|
&& this._cache.targetScreenOffset.equals(this.targetScreenOffset);
|
|
};
|
|
};
|
|
- // Methods
|
|
|
|
|
|
+ /**
|
|
|
|
+ * Attached controls to the current camera.
|
|
|
|
+ * @param element Defines the element the controls should be listened from
|
|
|
|
+ * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
|
|
|
|
+ * @param useCtrlForPanning Defines whether ctrl is used for paning within the controls
|
|
|
|
+ * @param panningMouseButton Defines whether panning is allowed through mouse click button
|
|
|
|
+ */
|
|
ArcRotateCamera.prototype.attachControl = function (element, noPreventDefault, useCtrlForPanning, panningMouseButton) {
|
|
ArcRotateCamera.prototype.attachControl = function (element, noPreventDefault, useCtrlForPanning, panningMouseButton) {
|
|
var _this = this;
|
|
var _this = this;
|
|
if (useCtrlForPanning === void 0) { useCtrlForPanning = true; }
|
|
if (useCtrlForPanning === void 0) { useCtrlForPanning = true; }
|
|
@@ -48026,6 +48219,11 @@ var BABYLON;
|
|
_this.inertialPanningY = 0;
|
|
_this.inertialPanningY = 0;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
+ /**
|
|
|
|
+ * Detach the current controls from the camera.
|
|
|
|
+ * The camera will stop reacting to inputs.
|
|
|
|
+ * @param element Defines the element to stop listening the inputs from
|
|
|
|
+ */
|
|
ArcRotateCamera.prototype.detachControl = function (element) {
|
|
ArcRotateCamera.prototype.detachControl = function (element) {
|
|
this.inputs.detachElement(element);
|
|
this.inputs.detachElement(element);
|
|
if (this._reset) {
|
|
if (this._reset) {
|
|
@@ -48132,6 +48330,9 @@ var BABYLON;
|
|
this.radius = this.upperRadiusLimit;
|
|
this.radius = this.upperRadiusLimit;
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
+ /**
|
|
|
|
+ * Rebuilds angles (alpha, beta) and radius from the give position and target.
|
|
|
|
+ */
|
|
ArcRotateCamera.prototype.rebuildAnglesAndRadius = function () {
|
|
ArcRotateCamera.prototype.rebuildAnglesAndRadius = function () {
|
|
this.position.subtractToRef(this._getTargetPosition(), this._computationVector);
|
|
this.position.subtractToRef(this._getTargetPosition(), this._computationVector);
|
|
this.radius = this._computationVector.length();
|
|
this.radius = this._computationVector.length();
|
|
@@ -48147,6 +48348,10 @@ var BABYLON;
|
|
this.beta = Math.acos(this._computationVector.y / this.radius);
|
|
this.beta = Math.acos(this._computationVector.y / this.radius);
|
|
this._checkLimits();
|
|
this._checkLimits();
|
|
};
|
|
};
|
|
|
|
+ /**
|
|
|
|
+ * Use a position to define the current camera related information like aplha, beta and radius
|
|
|
|
+ * @param position Defines the position to set the camera at
|
|
|
|
+ */
|
|
ArcRotateCamera.prototype.setPosition = function (position) {
|
|
ArcRotateCamera.prototype.setPosition = function (position) {
|
|
if (this.position.equals(position)) {
|
|
if (this.position.equals(position)) {
|
|
return;
|
|
return;
|
|
@@ -48154,6 +48359,13 @@ var BABYLON;
|
|
this.position.copyFrom(position);
|
|
this.position.copyFrom(position);
|
|
this.rebuildAnglesAndRadius();
|
|
this.rebuildAnglesAndRadius();
|
|
};
|
|
};
|
|
|
|
+ /**
|
|
|
|
+ * Defines the target the camera should look at.
|
|
|
|
+ * This will automatically adapt alpha beta and radius to fit within the new target.
|
|
|
|
+ * @param target Defines the new target as a Vector or a mesh
|
|
|
|
+ * @param toBoundingCenter In case of a mesh target, defines wether to target the mesh position or its bounding information center
|
|
|
|
+ * @param allowSamePosition If false, prevents reapplying the new computed position if it is identical to the current one (optim)
|
|
|
|
+ */
|
|
ArcRotateCamera.prototype.setTarget = function (target, toBoundingCenter, allowSamePosition) {
|
|
ArcRotateCamera.prototype.setTarget = function (target, toBoundingCenter, allowSamePosition) {
|
|
if (toBoundingCenter === void 0) { toBoundingCenter = false; }
|
|
if (toBoundingCenter === void 0) { toBoundingCenter = false; }
|
|
if (allowSamePosition === void 0) { allowSamePosition = false; }
|
|
if (allowSamePosition === void 0) { allowSamePosition = false; }
|
|
@@ -48217,6 +48429,11 @@ var BABYLON;
|
|
this._currentTarget = target;
|
|
this._currentTarget = target;
|
|
return this._viewMatrix;
|
|
return this._viewMatrix;
|
|
};
|
|
};
|
|
|
|
+ /**
|
|
|
|
+ * Zooms on a mesh to be at the min distance where we could see it fully in the current viewport.
|
|
|
|
+ * @param meshes Defines the mesh to zoom on
|
|
|
|
+ * @param doNotUpdateMaxZ Defines whether or not maxZ should be updated whilst zooming on the mesh (this can happen if the mesh is big and the maxradius pretty small for instance)
|
|
|
|
+ */
|
|
ArcRotateCamera.prototype.zoomOn = function (meshes, doNotUpdateMaxZ) {
|
|
ArcRotateCamera.prototype.zoomOn = function (meshes, doNotUpdateMaxZ) {
|
|
if (doNotUpdateMaxZ === void 0) { doNotUpdateMaxZ = false; }
|
|
if (doNotUpdateMaxZ === void 0) { doNotUpdateMaxZ = false; }
|
|
meshes = meshes || this.getScene().meshes;
|
|
meshes = meshes || this.getScene().meshes;
|
|
@@ -48225,6 +48442,12 @@ var BABYLON;
|
|
this.radius = distance * this.zoomOnFactor;
|
|
this.radius = distance * this.zoomOnFactor;
|
|
this.focusOn({ min: minMaxVector.min, max: minMaxVector.max, distance: distance }, doNotUpdateMaxZ);
|
|
this.focusOn({ min: minMaxVector.min, max: minMaxVector.max, distance: distance }, doNotUpdateMaxZ);
|
|
};
|
|
};
|
|
|
|
+ /**
|
|
|
|
+ * Focus on a mesh or a bounding box. This adapts the target and maxRadius if necessary but does not update the current radius.
|
|
|
|
+ * The target will be changed but the radius
|
|
|
|
+ * @param meshesOrMinMaxVectorAndDistance Defines the mesh or bounding info to focus on
|
|
|
|
+ * @param doNotUpdateMaxZ Defines whether or not maxZ should be updated whilst zooming on the mesh (this can happen if the mesh is big and the maxradius pretty small for instance)
|
|
|
|
+ */
|
|
ArcRotateCamera.prototype.focusOn = function (meshesOrMinMaxVectorAndDistance, doNotUpdateMaxZ) {
|
|
ArcRotateCamera.prototype.focusOn = function (meshesOrMinMaxVectorAndDistance, doNotUpdateMaxZ) {
|
|
if (doNotUpdateMaxZ === void 0) { doNotUpdateMaxZ = false; }
|
|
if (doNotUpdateMaxZ === void 0) { doNotUpdateMaxZ = false; }
|
|
var meshesOrMinMaxVector;
|
|
var meshesOrMinMaxVector;
|
|
@@ -48290,10 +48513,17 @@ var BABYLON;
|
|
}
|
|
}
|
|
_super.prototype._updateRigCameras.call(this);
|
|
_super.prototype._updateRigCameras.call(this);
|
|
};
|
|
};
|
|
|
|
+ /**
|
|
|
|
+ * Destroy the camera and release the current resources hold by it.
|
|
|
|
+ */
|
|
ArcRotateCamera.prototype.dispose = function () {
|
|
ArcRotateCamera.prototype.dispose = function () {
|
|
this.inputs.clear();
|
|
this.inputs.clear();
|
|
_super.prototype.dispose.call(this);
|
|
_super.prototype.dispose.call(this);
|
|
};
|
|
};
|
|
|
|
+ /**
|
|
|
|
+ * Gets the current object class name.
|
|
|
|
+ * @return the class name
|
|
|
|
+ */
|
|
ArcRotateCamera.prototype.getClassName = function () {
|
|
ArcRotateCamera.prototype.getClassName = function () {
|
|
return "ArcRotateCamera";
|
|
return "ArcRotateCamera";
|
|
};
|
|
};
|
|
@@ -48359,6 +48589,9 @@ var BABYLON;
|
|
], ArcRotateCamera.prototype, "zoomOnFactor", void 0);
|
|
], ArcRotateCamera.prototype, "zoomOnFactor", void 0);
|
|
__decorate([
|
|
__decorate([
|
|
BABYLON.serialize()
|
|
BABYLON.serialize()
|
|
|
|
+ ], ArcRotateCamera.prototype, "targetScreenOffset", void 0);
|
|
|
|
+ __decorate([
|
|
|
|
+ BABYLON.serialize()
|
|
], ArcRotateCamera.prototype, "allowUpsideDown", void 0);
|
|
], ArcRotateCamera.prototype, "allowUpsideDown", void 0);
|
|
return ArcRotateCamera;
|
|
return ArcRotateCamera;
|
|
}(BABYLON.TargetCamera));
|
|
}(BABYLON.TargetCamera));
|
|
@@ -50683,7 +50916,16 @@ var BABYLON;
|
|
* Use this class to create coordinated animations on multiple targets
|
|
* Use this class to create coordinated animations on multiple targets
|
|
*/
|
|
*/
|
|
var AnimationGroup = /** @class */ (function () {
|
|
var AnimationGroup = /** @class */ (function () {
|
|
- function AnimationGroup(name, scene) {
|
|
|
|
|
|
+ /**
|
|
|
|
+ * Instantiates a new Animation Group.
|
|
|
|
+ * This helps managing several animations at once.
|
|
|
|
+ * @see http://doc.babylonjs.com/how_to/group
|
|
|
|
+ * @param name Defines the name of the group
|
|
|
|
+ * @param scene Defines the scene the group belongs to
|
|
|
|
+ */
|
|
|
|
+ function AnimationGroup(
|
|
|
|
+ /** The name of the animation group */
|
|
|
|
+ name, scene) {
|
|
if (scene === void 0) { scene = null; }
|
|
if (scene === void 0) { scene = null; }
|
|
this.name = name;
|
|
this.name = name;
|
|
this._targetedAnimations = new Array();
|
|
this._targetedAnimations = new Array();
|
|
@@ -50691,6 +50933,9 @@ var BABYLON;
|
|
this._from = Number.MAX_VALUE;
|
|
this._from = Number.MAX_VALUE;
|
|
this._to = -Number.MAX_VALUE;
|
|
this._to = -Number.MAX_VALUE;
|
|
this._speedRatio = 1;
|
|
this._speedRatio = 1;
|
|
|
|
+ /**
|
|
|
|
+ * This observable will notify when one animation have ended.
|
|
|
|
+ */
|
|
this.onAnimationEndObservable = new BABYLON.Observable();
|
|
this.onAnimationEndObservable = new BABYLON.Observable();
|
|
/**
|
|
/**
|
|
* This observable will notify when all animations have ended.
|
|
* This observable will notify when all animations have ended.
|
|
@@ -50802,6 +51047,7 @@ var BABYLON;
|
|
* It can add constant keys at begin or end
|
|
* It can add constant keys at begin or end
|
|
* @param beginFrame defines the new begin frame for all animations or the smallest begin frame of all animations if null (defaults to null)
|
|
* @param beginFrame defines the new begin frame for all animations or the smallest begin frame of all animations if null (defaults to null)
|
|
* @param endFrame defines the new end frame for all animations or the largest end frame of all animations if null (defaults to null)
|
|
* @param endFrame defines the new end frame for all animations or the largest end frame of all animations if null (defaults to null)
|
|
|
|
+ * @returns the animation group
|
|
*/
|
|
*/
|
|
AnimationGroup.prototype.normalize = function (beginFrame, endFrame) {
|
|
AnimationGroup.prototype.normalize = function (beginFrame, endFrame) {
|
|
if (beginFrame === void 0) { beginFrame = null; }
|
|
if (beginFrame === void 0) { beginFrame = null; }
|
|
@@ -50874,6 +51120,7 @@ var BABYLON;
|
|
};
|
|
};
|
|
/**
|
|
/**
|
|
* Pause all animations
|
|
* Pause all animations
|
|
|
|
+ * @returns the animation group
|
|
*/
|
|
*/
|
|
AnimationGroup.prototype.pause = function () {
|
|
AnimationGroup.prototype.pause = function () {
|
|
if (!this._isStarted) {
|
|
if (!this._isStarted) {
|
|
@@ -50890,6 +51137,7 @@ var BABYLON;
|
|
* Play all animations to initial state
|
|
* Play all animations to initial state
|
|
* This function will start() the animations if they were not started or will restart() them if they were paused
|
|
* This function will start() the animations if they were not started or will restart() them if they were paused
|
|
* @param loop defines if animations must loop
|
|
* @param loop defines if animations must loop
|
|
|
|
+ * @returns the animation group
|
|
*/
|
|
*/
|
|
AnimationGroup.prototype.play = function (loop) {
|
|
AnimationGroup.prototype.play = function (loop) {
|
|
// only if all animatables are ready and exist
|
|
// only if all animatables are ready and exist
|
|
@@ -50910,6 +51158,7 @@ var BABYLON;
|
|
};
|
|
};
|
|
/**
|
|
/**
|
|
* Reset all animations to initial state
|
|
* Reset all animations to initial state
|
|
|
|
+ * @returns the animation group
|
|
*/
|
|
*/
|
|
AnimationGroup.prototype.reset = function () {
|
|
AnimationGroup.prototype.reset = function () {
|
|
if (!this._isStarted) {
|
|
if (!this._isStarted) {
|
|
@@ -50923,6 +51172,7 @@ var BABYLON;
|
|
};
|
|
};
|
|
/**
|
|
/**
|
|
* Restart animations from key 0
|
|
* Restart animations from key 0
|
|
|
|
+ * @returns the animation group
|
|
*/
|
|
*/
|
|
AnimationGroup.prototype.restart = function () {
|
|
AnimationGroup.prototype.restart = function () {
|
|
if (!this._isStarted) {
|
|
if (!this._isStarted) {
|
|
@@ -50936,6 +51186,7 @@ var BABYLON;
|
|
};
|
|
};
|
|
/**
|
|
/**
|
|
* Stop all animations
|
|
* Stop all animations
|
|
|
|
+ * @returns the animation group
|
|
*/
|
|
*/
|
|
AnimationGroup.prototype.stop = function () {
|
|
AnimationGroup.prototype.stop = function () {
|
|
if (!this._isStarted) {
|
|
if (!this._isStarted) {
|
|
@@ -77851,9 +78102,30 @@ var BABYLON;
|
|
return FollowCamera;
|
|
return FollowCamera;
|
|
}(BABYLON.TargetCamera));
|
|
}(BABYLON.TargetCamera));
|
|
BABYLON.FollowCamera = FollowCamera;
|
|
BABYLON.FollowCamera = FollowCamera;
|
|
|
|
+ /**
|
|
|
|
+ * Arc Rotate version of the follow camera.
|
|
|
|
+ * It still follows a defined mesh but in an Arc Rotate Camera fashion.
|
|
|
|
+ */
|
|
var ArcFollowCamera = /** @class */ (function (_super) {
|
|
var ArcFollowCamera = /** @class */ (function (_super) {
|
|
__extends(ArcFollowCamera, _super);
|
|
__extends(ArcFollowCamera, _super);
|
|
- function ArcFollowCamera(name, alpha, beta, radius, target, scene) {
|
|
|
|
|
|
+ /**
|
|
|
|
+ * Instantiates a new ArcFollowCamera
|
|
|
|
+ * @param name Defines the name of the camera
|
|
|
|
+ * @param alpha Defines the rotation angle of the camera around the logitudinal axis
|
|
|
|
+ * @param beta Defines the rotation angle of the camera around the elevation axis
|
|
|
|
+ * @param radius Defines the radius of the camera from its target point
|
|
|
|
+ * @param target Defines the target of the camera
|
|
|
|
+ * @param scene Defines the scene the camera belongs to
|
|
|
|
+ */
|
|
|
|
+ function ArcFollowCamera(name,
|
|
|
|
+ /** The longitudinal angle of the camera */
|
|
|
|
+ alpha,
|
|
|
|
+ /** The latitudinal angle of the camera */
|
|
|
|
+ beta,
|
|
|
|
+ /** The radius of the camera from its target */
|
|
|
|
+ radius,
|
|
|
|
+ /** Defines the camera target (the messh it should follow) */
|
|
|
|
+ target, scene) {
|
|
var _this = _super.call(this, name, BABYLON.Vector3.Zero(), scene) || this;
|
|
var _this = _super.call(this, name, BABYLON.Vector3.Zero(), scene) || this;
|
|
_this.alpha = alpha;
|
|
_this.alpha = alpha;
|
|
_this.beta = beta;
|
|
_this.beta = beta;
|
|
@@ -77879,6 +78151,10 @@ var BABYLON;
|
|
_super.prototype._checkInputs.call(this);
|
|
_super.prototype._checkInputs.call(this);
|
|
this.follow();
|
|
this.follow();
|
|
};
|
|
};
|
|
|
|
+ /**
|
|
|
|
+ * Returns the class name of the object.
|
|
|
|
+ * It is mostly used internally for serialization purposes.
|
|
|
|
+ */
|
|
ArcFollowCamera.prototype.getClassName = function () {
|
|
ArcFollowCamera.prototype.getClassName = function () {
|
|
return "ArcFollowCamera";
|
|
return "ArcFollowCamera";
|
|
};
|
|
};
|