|
@@ -17864,16 +17864,29 @@ var BABYLON;
|
|
|
var BABYLON;
|
|
|
(function (BABYLON) {
|
|
|
var BoundingSphere = /** @class */ (function () {
|
|
|
- function BoundingSphere(minimum, maximum) {
|
|
|
- this.minimum = minimum;
|
|
|
- this.maximum = maximum;
|
|
|
+ /**
|
|
|
+ * Creates a new bounding sphere
|
|
|
+ * @param min defines the minimum vector (in local space)
|
|
|
+ * @param max defines the maximum vector (in local space)
|
|
|
+ */
|
|
|
+ function BoundingSphere(min, max) {
|
|
|
this._tempRadiusVector = BABYLON.Vector3.Zero();
|
|
|
- var distance = BABYLON.Vector3.Distance(minimum, maximum);
|
|
|
- this.center = BABYLON.Vector3.Lerp(minimum, maximum, 0.5);
|
|
|
+ this.reConstruct(min, max);
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Recreates the entire bounding sphere from scratch
|
|
|
+ * @param min defines the new minimum vector (in local space)
|
|
|
+ * @param max defines the new maximum vector (in local space)
|
|
|
+ */
|
|
|
+ BoundingSphere.prototype.reConstruct = function (min, max) {
|
|
|
+ this.minimum = min.clone();
|
|
|
+ this.maximum = max.clone();
|
|
|
+ var distance = BABYLON.Vector3.Distance(min, max);
|
|
|
+ this.center = BABYLON.Vector3.Lerp(min, max, 0.5);
|
|
|
this.radius = distance * 0.5;
|
|
|
this.centerWorld = BABYLON.Vector3.Zero();
|
|
|
this._update(BABYLON.Matrix.Identity());
|
|
|
- }
|
|
|
+ };
|
|
|
// Methods
|
|
|
BoundingSphere.prototype._update = function (world) {
|
|
|
BABYLON.Vector3.TransformCoordinatesToRef(this.center, world, this.centerWorld);
|
|
@@ -17916,12 +17929,26 @@ var BABYLON;
|
|
|
var BABYLON;
|
|
|
(function (BABYLON) {
|
|
|
var BoundingBox = /** @class */ (function () {
|
|
|
- function BoundingBox(minimum, maximum) {
|
|
|
- this.minimum = minimum;
|
|
|
- this.maximum = maximum;
|
|
|
- this.vectors = new Array();
|
|
|
+ /**
|
|
|
+ * Creates a new bounding box
|
|
|
+ * @param min defines the minimum vector (in local space)
|
|
|
+ * @param max defines the maximum vector (in local space)
|
|
|
+ */
|
|
|
+ function BoundingBox(min, max) {
|
|
|
this.vectorsWorld = new Array();
|
|
|
+ this.reConstruct(min, max);
|
|
|
+ }
|
|
|
+ // Methods
|
|
|
+ /**
|
|
|
+ * Recreates the entire bounding box from scratch
|
|
|
+ * @param min defines the new minimum vector (in local space)
|
|
|
+ * @param max defines the new maximum vector (in local space)
|
|
|
+ */
|
|
|
+ BoundingBox.prototype.reConstruct = function (min, max) {
|
|
|
+ this.minimum = min.clone();
|
|
|
+ this.maximum = max.clone();
|
|
|
// Bounding vectors
|
|
|
+ this.vectors = new Array();
|
|
|
this.vectors.push(this.minimum.clone());
|
|
|
this.vectors.push(this.maximum.clone());
|
|
|
this.vectors.push(this.minimum.clone());
|
|
@@ -17948,9 +17975,8 @@ var BABYLON;
|
|
|
this.maximumWorld = BABYLON.Vector3.Zero();
|
|
|
this.centerWorld = BABYLON.Vector3.Zero();
|
|
|
this.extendSizeWorld = BABYLON.Vector3.Zero();
|
|
|
- this._update(BABYLON.Matrix.Identity());
|
|
|
- }
|
|
|
- // Methods
|
|
|
+ this._update(this._worldMatrix || BABYLON.Matrix.Identity());
|
|
|
+ };
|
|
|
BoundingBox.prototype.getWorldMatrix = function () {
|
|
|
return this._worldMatrix;
|
|
|
};
|
|
@@ -19497,10 +19523,7 @@ var BABYLON;
|
|
|
if (!this.subMeshes) {
|
|
|
return;
|
|
|
}
|
|
|
- for (var _i = 0, _a = this.subMeshes; _i < _a.length; _i++) {
|
|
|
- var subMesh = _a[_i];
|
|
|
- subMesh.setEffect(null);
|
|
|
- }
|
|
|
+ this._unBindEffect();
|
|
|
},
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
@@ -19717,6 +19740,13 @@ var BABYLON;
|
|
|
}
|
|
|
this._markSubMeshesAsLightDirty();
|
|
|
};
|
|
|
+ /** @ignore */
|
|
|
+ AbstractMesh.prototype._unBindEffect = function () {
|
|
|
+ for (var _i = 0, _a = this.subMeshes; _i < _a.length; _i++) {
|
|
|
+ var subMesh = _a[_i];
|
|
|
+ subMesh.setEffect(null);
|
|
|
+ }
|
|
|
+ };
|
|
|
AbstractMesh.prototype._removeLightSource = function (light) {
|
|
|
var index = this._lightSources.indexOf(light);
|
|
|
if (index === -1) {
|
|
@@ -30865,6 +30895,13 @@ var BABYLON;
|
|
|
}
|
|
|
return ret;
|
|
|
};
|
|
|
+ Mesh.prototype._unBindEffect = function () {
|
|
|
+ _super.prototype._unBindEffect.call(this);
|
|
|
+ for (var _i = 0, _a = this.instances; _i < _a.length; _i++) {
|
|
|
+ var instance = _a[_i];
|
|
|
+ instance._unBindEffect();
|
|
|
+ }
|
|
|
+ };
|
|
|
Object.defineProperty(Mesh.prototype, "hasLODLevels", {
|
|
|
/**
|
|
|
* True if the mesh has some Levels Of Details (LOD).
|
|
@@ -43220,11 +43257,17 @@ var BABYLON;
|
|
|
};
|
|
|
StandardMaterial.prototype.unbind = function () {
|
|
|
if (this._activeEffect) {
|
|
|
+ var needFlag = false;
|
|
|
if (this._reflectionTexture && this._reflectionTexture.isRenderTarget) {
|
|
|
this._activeEffect.setTexture("reflection2DSampler", null);
|
|
|
+ needFlag = true;
|
|
|
}
|
|
|
if (this._refractionTexture && this._refractionTexture.isRenderTarget) {
|
|
|
this._activeEffect.setTexture("refraction2DSampler", null);
|
|
|
+ needFlag = true;
|
|
|
+ }
|
|
|
+ if (needFlag) {
|
|
|
+ this._markAllSubMeshesAsTexturesDirty();
|
|
|
}
|
|
|
}
|
|
|
_super.prototype.unbind.call(this);
|
|
@@ -50803,21 +50846,15 @@ var BABYLON;
|
|
|
if (this._isStarted || this._targetedAnimations.length === 0) {
|
|
|
return this;
|
|
|
}
|
|
|
- var _loop_1 = function () {
|
|
|
- var targetedAnimation = this_1._targetedAnimations[index];
|
|
|
- if (!targetedAnimation.target.animations) {
|
|
|
- targetedAnimation.target.animations = [];
|
|
|
- }
|
|
|
- if (targetedAnimation.target.animations.indexOf(targetedAnimation.animation) === -1) {
|
|
|
- targetedAnimation.target.animations.push(targetedAnimation.animation);
|
|
|
- }
|
|
|
+ var _loop_1 = function (targetedAnimation) {
|
|
|
this_1._animatables.push(this_1._scene.beginDirectAnimation(targetedAnimation.target, [targetedAnimation.animation], from !== undefined ? from : this_1._from, to !== undefined ? to : this_1._to, loop, speedRatio, function () {
|
|
|
_this.onAnimationEndObservable.notifyObservers(targetedAnimation);
|
|
|
}));
|
|
|
};
|
|
|
var this_1 = this;
|
|
|
- for (var index = 0; index < this._targetedAnimations.length; index++) {
|
|
|
- _loop_1();
|
|
|
+ for (var _i = 0, _a = this._targetedAnimations; _i < _a.length; _i++) {
|
|
|
+ var targetedAnimation = _a[_i];
|
|
|
+ _loop_1(targetedAnimation);
|
|
|
}
|
|
|
this._speedRatio = speedRatio;
|
|
|
this._isStarted = true;
|
|
@@ -51271,7 +51308,7 @@ var BABYLON;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- else if (this._originalBlendValue.constructor) { // Complex value
|
|
|
+ else {
|
|
|
var constructor = this._originalBlendValue.constructor;
|
|
|
if (constructor.Lerp) { // Lerp supported
|
|
|
this._currentValue = constructor.Lerp(this._originalBlendValue, currentValue, this._blendingFactor);
|
|
@@ -51279,13 +51316,13 @@ var BABYLON;
|
|
|
else if (constructor.Slerp) { // Slerp supported
|
|
|
this._currentValue = constructor.Slerp(this._originalBlendValue, currentValue, this._blendingFactor);
|
|
|
}
|
|
|
+ else if (this._originalBlendValue.toFixed) { // Number
|
|
|
+ this._currentValue = this._originalBlendValue * (1.0 - this._blendingFactor) + this._blendingFactor * currentValue;
|
|
|
+ }
|
|
|
else { // Blending not supported
|
|
|
this._currentValue = currentValue;
|
|
|
}
|
|
|
}
|
|
|
- else { // Direct value
|
|
|
- this._currentValue = this._originalBlendValue * (1.0 - this._blendingFactor) + this._blendingFactor * currentValue;
|
|
|
- }
|
|
|
this._blendingFactor += blendingSpeed;
|
|
|
}
|
|
|
else {
|
|
@@ -52077,10 +52114,16 @@ var BABYLON;
|
|
|
* @param actionManager manager for the action the condition applies to
|
|
|
* @param target for the action
|
|
|
* @param propertyPath path to specify the property of the target the conditional operator uses
|
|
|
- * @param value the vale compared by the conditional operator against the current value of the property
|
|
|
- * @param operator the conditional operator, default {BABYLON.ValueCondition.IsEqual}
|
|
|
- */
|
|
|
- function ValueCondition(actionManager, target, propertyPath, value, operator) {
|
|
|
+ * @param value the value compared by the conditional operator against the current value of the property
|
|
|
+ * @param operator the conditional operator, default ValueCondition.IsEqual
|
|
|
+ */
|
|
|
+ function ValueCondition(actionManager, target,
|
|
|
+ /** path to specify the property of the target the conditional operator uses */
|
|
|
+ propertyPath,
|
|
|
+ /** the value compared by the conditional operator against the current value of the property */
|
|
|
+ value,
|
|
|
+ /** the conditional operator, default ValueCondition.IsEqual */
|
|
|
+ operator) {
|
|
|
if (operator === void 0) { operator = ValueCondition.IsEqual; }
|
|
|
var _this = _super.call(this, actionManager) || this;
|
|
|
_this.propertyPath = propertyPath;
|
|
@@ -52212,11 +52255,13 @@ var BABYLON;
|
|
|
var PredicateCondition = /** @class */ (function (_super) {
|
|
|
__extends(PredicateCondition, _super);
|
|
|
/**
|
|
|
- * Creates a new {BABYLON.PredicateCondition}
|
|
|
+ * Creates a new PredicateCondition
|
|
|
* @param actionManager manager for the action the condition applies to
|
|
|
- * @param predicate
|
|
|
+ * @param predicate defines the predicate function used to validate the condition
|
|
|
*/
|
|
|
- function PredicateCondition(actionManager, predicate) {
|
|
|
+ function PredicateCondition(actionManager,
|
|
|
+ /** defines the predicate function used to validate the condition */
|
|
|
+ predicate) {
|
|
|
var _this = _super.call(this, actionManager) || this;
|
|
|
_this.predicate = predicate;
|
|
|
return _this;
|
|
@@ -52231,12 +52276,12 @@ var BABYLON;
|
|
|
}(Condition));
|
|
|
BABYLON.PredicateCondition = PredicateCondition;
|
|
|
/**
|
|
|
- * Defines a state condition as an extension of {BABYLON.Condition}
|
|
|
+ * Defines a state condition as an extension of Condition
|
|
|
*/
|
|
|
var StateCondition = /** @class */ (function (_super) {
|
|
|
__extends(StateCondition, _super);
|
|
|
/**
|
|
|
- * Creates a new {BABYLON.StateCondition}
|
|
|
+ * Creates a new StateCondition
|
|
|
* @param actionManager manager for the action the condition applies to
|
|
|
* @param target of the condition
|
|
|
* @param value to compare with target state
|
|
@@ -52254,7 +52299,7 @@ var BABYLON;
|
|
|
return this._target.state === this.value;
|
|
|
};
|
|
|
/**
|
|
|
- * Serialize the {BABYLON.StateCondition} into a JSON compatible object
|
|
|
+ * Serialize the StateCondition into a JSON compatible object
|
|
|
* @returns serialization object
|
|
|
*/
|
|
|
StateCondition.prototype.serialize = function () {
|
|
@@ -52531,7 +52576,7 @@ var BABYLON;
|
|
|
// Members
|
|
|
this.actions = new Array();
|
|
|
this.hoverCursor = '';
|
|
|
- this._scene = scene;
|
|
|
+ this._scene = scene || BABYLON.Engine.LastCreatedScene;
|
|
|
scene._actionManagers.push(this);
|
|
|
}
|
|
|
Object.defineProperty(ActionManager, "NothingTrigger", {
|
|
@@ -61104,9 +61149,19 @@ var BABYLON;
|
|
|
* Returns true if the decoder is available.
|
|
|
*/
|
|
|
get: function () {
|
|
|
- return (typeof DracoDecoderModule !== "undefined" ||
|
|
|
- (typeof WebAssembly === "object" && !!DracoCompression.Configuration.decoderWasm) ||
|
|
|
- !!DracoCompression.Configuration.decoder);
|
|
|
+ if (typeof DracoDecoderModule !== "undefined") {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ var decoder = DracoCompression.Configuration.decoder;
|
|
|
+ if (decoder) {
|
|
|
+ if (decoder.wasmUrl && decoder.wasmBinaryUrl && typeof WebAssembly === "object") {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ if (decoder.fallbackUrl) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
},
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
@@ -61196,24 +61251,29 @@ var BABYLON;
|
|
|
};
|
|
|
DracoCompression._GetDecoderModule = function () {
|
|
|
if (!DracoCompression._DecoderModulePromise) {
|
|
|
- var promise = void 0;
|
|
|
+ var promise = null;
|
|
|
var config_1 = {};
|
|
|
if (typeof DracoDecoderModule !== "undefined") {
|
|
|
promise = Promise.resolve();
|
|
|
}
|
|
|
- else if (typeof WebAssembly === "object" && DracoCompression.Configuration.decoderWasm) {
|
|
|
- promise = Promise.all([
|
|
|
- DracoCompression._LoadScriptAsync(DracoCompression.Configuration.decoderWasm.wrapperUrl),
|
|
|
- DracoCompression._LoadFileAsync(DracoCompression.Configuration.decoderWasm.binaryUrl).then(function (data) {
|
|
|
- config_1.wasmBinary = data;
|
|
|
- })
|
|
|
- ]);
|
|
|
- }
|
|
|
- else if (DracoCompression.Configuration.decoder) {
|
|
|
- promise = DracoCompression._LoadScriptAsync(DracoCompression.Configuration.decoder.url);
|
|
|
- }
|
|
|
else {
|
|
|
- throw new Error("Invalid decoder configuration");
|
|
|
+ var decoder = DracoCompression.Configuration.decoder;
|
|
|
+ if (decoder) {
|
|
|
+ if (decoder.wasmUrl && decoder.wasmBinaryUrl && typeof WebAssembly === "object") {
|
|
|
+ promise = Promise.all([
|
|
|
+ DracoCompression._LoadScriptAsync(decoder.wasmUrl),
|
|
|
+ DracoCompression._LoadFileAsync(decoder.wasmBinaryUrl).then(function (data) {
|
|
|
+ config_1.wasmBinary = data;
|
|
|
+ })
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+ else if (decoder.fallbackUrl) {
|
|
|
+ promise = DracoCompression._LoadScriptAsync(decoder.fallbackUrl);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!promise) {
|
|
|
+ throw new Error("Draco decoder module is not available");
|
|
|
}
|
|
|
DracoCompression._DecoderModulePromise = promise.then(function () {
|
|
|
return new Promise(function (resolve) {
|
|
@@ -61245,51 +61305,16 @@ var BABYLON;
|
|
|
});
|
|
|
});
|
|
|
};
|
|
|
- DracoCompression._GetDefaultConfig = function () {
|
|
|
- var configuration = {
|
|
|
- decoder: null,
|
|
|
- decoderWasm: null
|
|
|
- };
|
|
|
- if (BABYLON.Tools.IsWindowObjectExist()) {
|
|
|
- var decoderUrl = null;
|
|
|
- var decoderWasmBinaryUrl = null;
|
|
|
- var decoderWasmWrapperUrl = null;
|
|
|
- for (var i = 0; i < document.scripts.length; i++) {
|
|
|
- var type = document.scripts[i].type;
|
|
|
- var src = document.scripts[i].src;
|
|
|
- switch (type) {
|
|
|
- case "text/x-draco-decoder": {
|
|
|
- decoderUrl = src;
|
|
|
- break;
|
|
|
- }
|
|
|
- case "text/x-draco-decoder-wasm-binary": {
|
|
|
- decoderWasmBinaryUrl = src;
|
|
|
- break;
|
|
|
- }
|
|
|
- case "text/x-draco-decoder-wasm-wrapper": {
|
|
|
- decoderWasmWrapperUrl = src;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (decoderUrl) {
|
|
|
- configuration.decoder = {
|
|
|
- url: decoderUrl
|
|
|
- };
|
|
|
- }
|
|
|
- if (decoderWasmWrapperUrl && decoderWasmBinaryUrl) {
|
|
|
- configuration.decoderWasm = {
|
|
|
- binaryUrl: decoderWasmBinaryUrl,
|
|
|
- wrapperUrl: decoderWasmWrapperUrl
|
|
|
- };
|
|
|
- }
|
|
|
- }
|
|
|
- return configuration;
|
|
|
- };
|
|
|
/**
|
|
|
- * Gets the configuration.
|
|
|
+ * The configuration.
|
|
|
*/
|
|
|
- DracoCompression.Configuration = DracoCompression._GetDefaultConfig();
|
|
|
+ DracoCompression.Configuration = {
|
|
|
+ decoder: {
|
|
|
+ wasmUrl: "https://preview.babylonjs.com/draco_wasm_wrapper_gltf.js",
|
|
|
+ wasmBinaryUrl: "https://preview.babylonjs.com/draco_decoder_gltf.wasm",
|
|
|
+ fallbackUrl: "https://preview.babylonjs.com/draco_decoder_gltf.js"
|
|
|
+ }
|
|
|
+ };
|
|
|
return DracoCompression;
|
|
|
}());
|
|
|
BABYLON.DracoCompression = DracoCompression;
|
|
@@ -77167,6 +77192,9 @@ var BABYLON;
|
|
|
var child = _a[_i];
|
|
|
var cm = child.getLocalMatrix();
|
|
|
cm.multiplyToRef(scaleMat, cm);
|
|
|
+ cm.m[12] *= x;
|
|
|
+ cm.m[13] *= y;
|
|
|
+ cm.m[14] *= z;
|
|
|
child._markAsDirtyAndDecompose();
|
|
|
}
|
|
|
this._markAsDirtyAndDecompose();
|
|
@@ -77690,13 +77718,37 @@ var BABYLON;
|
|
|
|
|
|
var BABYLON;
|
|
|
(function (BABYLON) {
|
|
|
- /** Class used to apply inverse kinematics to bones */
|
|
|
+ /**
|
|
|
+ * Class used to apply inverse kinematics to bones
|
|
|
+ * @see http://doc.babylonjs.com/how_to/how_to_use_bones_and_skeletons#boneikcontroller
|
|
|
+ */
|
|
|
var BoneIKController = /** @class */ (function () {
|
|
|
+ /**
|
|
|
+ * Creates a new BoneIKController
|
|
|
+ * @param mesh defines the mesh to control
|
|
|
+ * @param bone defines the bone to control
|
|
|
+ * @param options defines options to set up the controller
|
|
|
+ */
|
|
|
function BoneIKController(mesh, bone, options) {
|
|
|
+ /**
|
|
|
+ * Gets or sets the target position
|
|
|
+ */
|
|
|
this.targetPosition = BABYLON.Vector3.Zero();
|
|
|
+ /**
|
|
|
+ * Gets or sets the pole target position
|
|
|
+ */
|
|
|
this.poleTargetPosition = BABYLON.Vector3.Zero();
|
|
|
+ /**
|
|
|
+ * Gets or sets the pole target local offset
|
|
|
+ */
|
|
|
this.poleTargetLocalOffset = BABYLON.Vector3.Zero();
|
|
|
+ /**
|
|
|
+ * Gets or sets the pole angle
|
|
|
+ */
|
|
|
this.poleAngle = 0;
|
|
|
+ /**
|
|
|
+ * The amount to slerp (spherical linear interpolation) to the target. Set this to a value between 0 and 1 (a value of 1 disables slerp)
|
|
|
+ */
|
|
|
this.slerpAmount = 1;
|
|
|
this._bone1Quat = BABYLON.Quaternion.Identity();
|
|
|
this._bone1Mat = BABYLON.Matrix.Identity();
|
|
@@ -77772,6 +77824,9 @@ var BABYLON;
|
|
|
}
|
|
|
}
|
|
|
Object.defineProperty(BoneIKController.prototype, "maxAngle", {
|
|
|
+ /**
|
|
|
+ * Gets or sets maximum allowed angle
|
|
|
+ */
|
|
|
get: function () {
|
|
|
return this._maxAngle;
|
|
|
},
|
|
@@ -77793,6 +77848,9 @@ var BABYLON;
|
|
|
var b = this._bone2Length;
|
|
|
this._maxReach = Math.sqrt(a * a + b * b - 2 * a * b * Math.cos(ang));
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Force the controller to update the bones
|
|
|
+ */
|
|
|
BoneIKController.prototype.update = function () {
|
|
|
var bone1 = this._bone1;
|
|
|
if (!bone1) {
|
|
@@ -77904,6 +77962,10 @@ var BABYLON;
|
|
|
|
|
|
var BABYLON;
|
|
|
(function (BABYLON) {
|
|
|
+ /**
|
|
|
+ * Class used to make a bone look toward a point in space
|
|
|
+ * @see http://doc.babylonjs.com/how_to/how_to_use_bones_and_skeletons#bonelookcontroller
|
|
|
+ */
|
|
|
var BoneLookController = /** @class */ (function () {
|
|
|
/**
|
|
|
* Create a BoneLookController
|
|
@@ -77911,42 +77973,42 @@ var BABYLON;
|
|
|
* @param bone the bone that will be looking to the target
|
|
|
* @param target the target Vector3 to look at
|
|
|
* @param settings optional settings:
|
|
|
- * - maxYaw: the maximum angle the bone will yaw to
|
|
|
- * - minYaw: the minimum angle the bone will yaw to
|
|
|
- * - maxPitch: the maximum angle the bone will pitch to
|
|
|
- * - minPitch: the minimum angle the bone will yaw to
|
|
|
- * - slerpAmount: set the between 0 and 1 to make the bone slerp to the target.
|
|
|
- * - upAxis: the up axis of the coordinate system
|
|
|
- * - upAxisSpace: the space that the up axis is in - BABYLON.Space.BONE, BABYLON.Space.LOCAL (default), or BABYLON.Space.WORLD.
|
|
|
- * - yawAxis: set yawAxis if the bone does not yaw on the y axis
|
|
|
- * - pitchAxis: set pitchAxis if the bone does not pitch on the x axis
|
|
|
- * - adjustYaw: used to make an adjustment to the yaw of the bone
|
|
|
- * - adjustPitch: used to make an adjustment to the pitch of the bone
|
|
|
- * - adjustRoll: used to make an adjustment to the roll of the bone
|
|
|
+ * * maxYaw: the maximum angle the bone will yaw to
|
|
|
+ * * minYaw: the minimum angle the bone will yaw to
|
|
|
+ * * maxPitch: the maximum angle the bone will pitch to
|
|
|
+ * * minPitch: the minimum angle the bone will yaw to
|
|
|
+ * * slerpAmount: set the between 0 and 1 to make the bone slerp to the target.
|
|
|
+ * * upAxis: the up axis of the coordinate system
|
|
|
+ * * upAxisSpace: the space that the up axis is in - BABYLON.Space.BONE, BABYLON.Space.LOCAL (default), or BABYLON.Space.WORLD.
|
|
|
+ * * yawAxis: set yawAxis if the bone does not yaw on the y axis
|
|
|
+ * * pitchAxis: set pitchAxis if the bone does not pitch on the x axis
|
|
|
+ * * adjustYaw: used to make an adjustment to the yaw of the bone
|
|
|
+ * * adjustPitch: used to make an adjustment to the pitch of the bone
|
|
|
+ * * adjustRoll: used to make an adjustment to the roll of the bone
|
|
|
**/
|
|
|
function BoneLookController(mesh, bone, target, options) {
|
|
|
/**
|
|
|
- * The up axis of the coordinate system that is used when the bone is rotated.
|
|
|
+ * The up axis of the coordinate system that is used when the bone is rotated
|
|
|
*/
|
|
|
this.upAxis = BABYLON.Vector3.Up();
|
|
|
/**
|
|
|
- * The space that the up axis is in - BABYLON.Space.BONE, BABYLON.Space.LOCAL (default), or BABYLON.Space.WORLD.
|
|
|
+ * The space that the up axis is in - BABYLON.Space.BONE, BABYLON.Space.LOCAL (default), or BABYLON.Space.WORLD
|
|
|
*/
|
|
|
this.upAxisSpace = BABYLON.Space.LOCAL;
|
|
|
/**
|
|
|
- * Used to make an adjustment to the yaw of the bone.
|
|
|
+ * Used to make an adjustment to the yaw of the bone
|
|
|
*/
|
|
|
this.adjustYaw = 0;
|
|
|
/**
|
|
|
- * Used to make an adjustment to the pitch of the bone.
|
|
|
+ * Used to make an adjustment to the pitch of the bone
|
|
|
*/
|
|
|
this.adjustPitch = 0;
|
|
|
/**
|
|
|
- * Used to make an adjustment to the roll of the bone.
|
|
|
+ * Used to make an adjustment to the roll of the bone
|
|
|
*/
|
|
|
this.adjustRoll = 0;
|
|
|
/**
|
|
|
- * The amount to slerp (spherical linear interpolation) to the target. Set this to a value between 0 and 1 (a value of 1 disables slerp).
|
|
|
+ * The amount to slerp (spherical linear interpolation) to the target. Set this to a value between 0 and 1 (a value of 1 disables slerp)
|
|
|
*/
|
|
|
this.slerpAmount = 1;
|
|
|
this._boneQuat = BABYLON.Quaternion.Identity();
|
|
@@ -78023,7 +78085,7 @@ var BABYLON;
|
|
|
}
|
|
|
Object.defineProperty(BoneLookController.prototype, "minYaw", {
|
|
|
/**
|
|
|
- * Get/set the minimum yaw angle that the bone can look to.
|
|
|
+ * Gets or sets the minimum yaw angle that the bone can look to
|
|
|
*/
|
|
|
get: function () {
|
|
|
return this._minYaw;
|
|
@@ -78042,7 +78104,7 @@ var BABYLON;
|
|
|
});
|
|
|
Object.defineProperty(BoneLookController.prototype, "maxYaw", {
|
|
|
/**
|
|
|
- * Get/set the maximum yaw angle that the bone can look to.
|
|
|
+ * Gets or sets the maximum yaw angle that the bone can look to
|
|
|
*/
|
|
|
get: function () {
|
|
|
return this._maxYaw;
|
|
@@ -78061,7 +78123,7 @@ var BABYLON;
|
|
|
});
|
|
|
Object.defineProperty(BoneLookController.prototype, "minPitch", {
|
|
|
/**
|
|
|
- * Get/set the minimum pitch angle that the bone can look to.
|
|
|
+ * Gets or sets the minimum pitch angle that the bone can look to
|
|
|
*/
|
|
|
get: function () {
|
|
|
return this._minPitch;
|
|
@@ -78075,7 +78137,7 @@ var BABYLON;
|
|
|
});
|
|
|
Object.defineProperty(BoneLookController.prototype, "maxPitch", {
|
|
|
/**
|
|
|
- * Get/set the maximum pitch angle that the bone can look to.
|
|
|
+ * Gets or sets the maximum pitch angle that the bone can look to
|
|
|
*/
|
|
|
get: function () {
|
|
|
return this._maxPitch;
|
|
@@ -78088,7 +78150,7 @@ var BABYLON;
|
|
|
configurable: true
|
|
|
});
|
|
|
/**
|
|
|
- * Update the bone to look at the target. This should be called before the scene is rendered (use scene.registerBeforeRender()).
|
|
|
+ * Update the bone to look at the target. This should be called before the scene is rendered (use scene.registerBeforeRender())
|
|
|
*/
|
|
|
BoneLookController.prototype.update = function () {
|
|
|
//skip the first frame when slerping so that the mesh rotation is correct
|
|
@@ -101328,6 +101390,9 @@ var BABYLON;
|
|
|
vertexData.indices = handledMesh.indices;
|
|
|
//Set the data from the VertexBuffer to the current BABYLON.Mesh
|
|
|
vertexData.applyToMesh(babylonMesh);
|
|
|
+ if (OBJFileLoader.INVERT_Y) {
|
|
|
+ babylonMesh.scaling.y *= -1;
|
|
|
+ }
|
|
|
//Push the mesh into an array
|
|
|
babylonMeshesArray.push(babylonMesh);
|
|
|
}
|
|
@@ -101369,6 +101434,7 @@ var BABYLON;
|
|
|
return babylonMeshesArray;
|
|
|
};
|
|
|
OBJFileLoader.OPTIMIZE_WITH_UV = false;
|
|
|
+ OBJFileLoader.INVERT_Y = false;
|
|
|
return OBJFileLoader;
|
|
|
}());
|
|
|
BABYLON.OBJFileLoader = OBJFileLoader;
|
|
@@ -104849,7 +104915,9 @@ var BABYLON;
|
|
|
}); }));
|
|
|
var morphTargets = new Array();
|
|
|
_this._forEachPrimitive(targetNode, function (babylonMesh) {
|
|
|
- morphTargets.push(babylonMesh.morphTargetManager.getTarget(targetIndex));
|
|
|
+ var morphTarget = babylonMesh.morphTargetManager.getTarget(targetIndex);
|
|
|
+ morphTarget.animations.push(babylonAnimation);
|
|
|
+ morphTargets.push(morphTarget);
|
|
|
});
|
|
|
babylonAnimationGroup.addTargetedAnimation(babylonAnimation, morphTargets);
|
|
|
};
|
|
@@ -104862,6 +104930,10 @@ var BABYLON;
|
|
|
var babylonAnimation = new BABYLON.Animation(animationName, targetPath, 1, animationType);
|
|
|
babylonAnimation.setKeys(keys);
|
|
|
if (targetNode._babylonAnimationTargets) {
|
|
|
+ for (var _i = 0, _a = targetNode._babylonAnimationTargets; _i < _a.length; _i++) {
|
|
|
+ var babylonAnimationTarget = _a[_i];
|
|
|
+ babylonAnimationTarget.animations.push(babylonAnimation);
|
|
|
+ }
|
|
|
babylonAnimationGroup.addTargetedAnimation(babylonAnimation, targetNode._babylonAnimationTargets);
|
|
|
}
|
|
|
}
|