|
@@ -2448,7 +2448,7 @@ var BABYLON;
|
|
return this;
|
|
return this;
|
|
};
|
|
};
|
|
/**
|
|
/**
|
|
- * Divides the current Vector3 coordinates by the given ones
|
|
|
|
|
|
+ * Divides the current Vector2 coordinates by the given ones
|
|
* @param otherVector defines the other vector
|
|
* @param otherVector defines the other vector
|
|
* @returns the current updated Vector2
|
|
* @returns the current updated Vector2
|
|
*/
|
|
*/
|
|
@@ -2522,6 +2522,20 @@ var BABYLON;
|
|
if (epsilon === void 0) { epsilon = BABYLON.Epsilon; }
|
|
if (epsilon === void 0) { epsilon = BABYLON.Epsilon; }
|
|
return otherVector && BABYLON.Scalar.WithinEpsilon(this.x, otherVector.x, epsilon) && BABYLON.Scalar.WithinEpsilon(this.y, otherVector.y, epsilon);
|
|
return otherVector && BABYLON.Scalar.WithinEpsilon(this.x, otherVector.x, epsilon) && BABYLON.Scalar.WithinEpsilon(this.y, otherVector.y, epsilon);
|
|
};
|
|
};
|
|
|
|
+ /**
|
|
|
|
+ * Gets a new Vector2 from current Vector2 floored values
|
|
|
|
+ * @returns a new Vector2
|
|
|
|
+ */
|
|
|
|
+ Vector2.prototype.floor = function () {
|
|
|
|
+ return new Vector2(Math.floor(this.x), Math.floor(this.y));
|
|
|
|
+ };
|
|
|
|
+ /**
|
|
|
|
+ * Gets a new Vector2 from current Vector2 floored values
|
|
|
|
+ * @returns a new Vector2
|
|
|
|
+ */
|
|
|
|
+ Vector2.prototype.fract = function () {
|
|
|
|
+ return new Vector2(this.x - Math.floor(this.x), this.y - Math.floor(this.y));
|
|
|
|
+ };
|
|
// Properties
|
|
// Properties
|
|
/**
|
|
/**
|
|
* Gets the length of the vector
|
|
* Gets the length of the vector
|
|
@@ -3163,6 +3177,20 @@ var BABYLON;
|
|
enumerable: true,
|
|
enumerable: true,
|
|
configurable: true
|
|
configurable: true
|
|
});
|
|
});
|
|
|
|
+ /**
|
|
|
|
+ * Gets a new Vector3 from current Vector3 floored values
|
|
|
|
+ * @returns a new Vector3
|
|
|
|
+ */
|
|
|
|
+ Vector3.prototype.floor = function () {
|
|
|
|
+ return new Vector3(Math.floor(this.x), Math.floor(this.y), Math.floor(this.z));
|
|
|
|
+ };
|
|
|
|
+ /**
|
|
|
|
+ * Gets a new Vector3 from current Vector3 floored values
|
|
|
|
+ * @returns a new Vector3
|
|
|
|
+ */
|
|
|
|
+ Vector3.prototype.fract = function () {
|
|
|
|
+ return new Vector3(this.x - Math.floor(this.x), this.y - Math.floor(this.y), this.z - Math.floor(this.z));
|
|
|
|
+ };
|
|
// Properties
|
|
// Properties
|
|
/**
|
|
/**
|
|
* Gets the length of the Vector3
|
|
* Gets the length of the Vector3
|
|
@@ -4093,6 +4121,20 @@ var BABYLON;
|
|
this.w = other.w;
|
|
this.w = other.w;
|
|
return this;
|
|
return this;
|
|
};
|
|
};
|
|
|
|
+ /**
|
|
|
|
+ * Gets a new Vector4 from current Vector4 floored values
|
|
|
|
+ * @returns a new Vector4
|
|
|
|
+ */
|
|
|
|
+ Vector4.prototype.floor = function () {
|
|
|
|
+ return new Vector4(Math.floor(this.x), Math.floor(this.y), Math.floor(this.z), Math.floor(this.w));
|
|
|
|
+ };
|
|
|
|
+ /**
|
|
|
|
+ * Gets a new Vector4 from current Vector3 floored values
|
|
|
|
+ * @returns a new Vector4
|
|
|
|
+ */
|
|
|
|
+ Vector4.prototype.fract = function () {
|
|
|
|
+ return new Vector4(this.x - Math.floor(this.x), this.y - Math.floor(this.y), this.z - Math.floor(this.z), this.w - Math.floor(this.w));
|
|
|
|
+ };
|
|
// Properties
|
|
// Properties
|
|
/**
|
|
/**
|
|
* Returns the Vector4 length (float).
|
|
* Returns the Vector4 length (float).
|
|
@@ -62986,6 +63028,7 @@ var BABYLON;
|
|
* * The parameter `shape` is a required array of successive Vector3. This array depicts the shape to be rotated in its local space : the shape must be designed in the xOy plane and will be rotated around the Y axis. It's usually a 2D shape, so the Vector3 z coordinates are often set to zero
|
|
* * The parameter `shape` is a required array of successive Vector3. This array depicts the shape to be rotated in its local space : the shape must be designed in the xOy plane and will be rotated around the Y axis. It's usually a 2D shape, so the Vector3 z coordinates are often set to zero
|
|
* * The parameter `radius` (positive float, default 1) is the radius value of the lathe
|
|
* * The parameter `radius` (positive float, default 1) is the radius value of the lathe
|
|
* * The parameter `tessellation` (positive integer, default 64) is the side number of the lathe
|
|
* * The parameter `tessellation` (positive integer, default 64) is the side number of the lathe
|
|
|
|
+ * * The parameter `clip` (positive integer, default 0) is the number of sides to not create without effecting the general shape of the sides
|
|
* * The parameter `arc` (positive float, default 1) is the ratio of the lathe. 0.5 builds for instance half a lathe, so an opened shape
|
|
* * The parameter `arc` (positive float, default 1) is the ratio of the lathe. 0.5 builds for instance half a lathe, so an opened shape
|
|
* * The parameter `closed` (boolean, default true) opens/closes the lathe circumference. This should be set to false when used with the parameter "arc"
|
|
* * The parameter `closed` (boolean, default true) opens/closes the lathe circumference. This should be set to false when used with the parameter "arc"
|
|
* * The parameter `cap` sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL
|
|
* * The parameter `cap` sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL
|
|
@@ -63005,6 +63048,7 @@ var BABYLON;
|
|
var shape = options.shape;
|
|
var shape = options.shape;
|
|
var radius = options.radius || 1;
|
|
var radius = options.radius || 1;
|
|
var tessellation = options.tessellation || 64;
|
|
var tessellation = options.tessellation || 64;
|
|
|
|
+ var clip = options.clip || 0;
|
|
var updatable = options.updatable;
|
|
var updatable = options.updatable;
|
|
var sideOrientation = MeshBuilder.updateSideOrientation(options.sideOrientation);
|
|
var sideOrientation = MeshBuilder.updateSideOrientation(options.sideOrientation);
|
|
var cap = options.cap || BABYLON.Mesh.NO_CAP;
|
|
var cap = options.cap || BABYLON.Mesh.NO_CAP;
|
|
@@ -63016,7 +63060,7 @@ var BABYLON;
|
|
var step = pi2 / tessellation * arc;
|
|
var step = pi2 / tessellation * arc;
|
|
var rotated;
|
|
var rotated;
|
|
var path = new Array();
|
|
var path = new Array();
|
|
- for (i = 0; i <= tessellation; i++) {
|
|
|
|
|
|
+ for (i = 0; i <= tessellation - clip; i++) {
|
|
var path = [];
|
|
var path = [];
|
|
if (cap == BABYLON.Mesh.CAP_START || cap == BABYLON.Mesh.CAP_ALL) {
|
|
if (cap == BABYLON.Mesh.CAP_START || cap == BABYLON.Mesh.CAP_ALL) {
|
|
path.push(new BABYLON.Vector3(0, shape[0].y, 0));
|
|
path.push(new BABYLON.Vector3(0, shape[0].y, 0));
|
|
@@ -104936,13 +104980,23 @@ var BABYLON;
|
|
* @param scene defines the hosting scene
|
|
* @param scene defines the hosting scene
|
|
* @returns the new Particle system
|
|
* @returns the new Particle system
|
|
*/
|
|
*/
|
|
- ParticleHelper.CreateDefault = function (emitter, scene) {
|
|
|
|
- var system = new BABYLON.ParticleSystem("default system", 1000, scene);
|
|
|
|
|
|
+ ParticleHelper.CreateDefault = function (emitter, capacity, scene) {
|
|
|
|
+ if (capacity === void 0) { capacity = 500; }
|
|
|
|
+ var system = new BABYLON.ParticleSystem("default system", capacity, scene);
|
|
system.emitter = emitter;
|
|
system.emitter = emitter;
|
|
system.particleTexture = new BABYLON.Texture("https://www.babylonjs.com/assets/Flare.png", system.getScene());
|
|
system.particleTexture = new BABYLON.Texture("https://www.babylonjs.com/assets/Flare.png", system.getScene());
|
|
|
|
+ system.createConeEmitter(0.1, Math.PI / 4);
|
|
|
|
+ // Particle color
|
|
|
|
+ system.color1 = new BABYLON.Color4(1.0, 1.0, 1.0, 1.0);
|
|
|
|
+ system.color2 = new BABYLON.Color4(1.0, 1.0, 1.0, 1.0);
|
|
|
|
+ system.colorDead = new BABYLON.Color4(1.0, 1.0, 1.0, 0.0);
|
|
|
|
+ // Particle Size
|
|
system.minSize = 0.1;
|
|
system.minSize = 0.1;
|
|
- system.maxSize = 0.5;
|
|
|
|
- system.emitRate = 200;
|
|
|
|
|
|
+ system.maxSize = 0.1;
|
|
|
|
+ // Emission speed
|
|
|
|
+ system.minEmitPower = 2;
|
|
|
|
+ system.maxEmitPower = 2;
|
|
|
|
+ system.emitRate = 30;
|
|
return system;
|
|
return system;
|
|
};
|
|
};
|
|
/**
|
|
/**
|