- Effect.prototype.setFloat3 = function (uniformName, x, y, z) {
- if (this._valueCache[uniformName] && this._valueCache[uniformName][0] === x && this._valueCache[uniformName][1] === y && this._valueCache[uniformName][2] === z)
- return this;
- this._cacheFloat3(uniformName, x, y, z);
- this._engine.setFloat3(this.getUniform(uniformName), x, y, z);
- return this;
- };
- Effect.prototype.setVector4 = function (uniformName, vector4) {
- Effect.prototype.setFloat4 = function (uniformName, x, y, z, w) {
- if (this._valueCache[uniformName] && this._valueCache[uniformName][0] === x && this._valueCache[uniformName][1] === y && this._valueCache[uniformName][2] === z && this._valueCache[uniformName][3] === w)
- return this;
- this._cacheFloat4(uniformName, x, y, z, w);
- this._engine.setFloat4(this.getUniform(uniformName), x, y, z, w);
- return this;
- };
- Effect.prototype.setColor3 = function (uniformName, color3) {
+ Effect.prototype.setFloat3 = function (uniformName, x, y, z) {
+ if (this._valueCache[uniformName] && this._valueCache[uniformName][0] === x && this._valueCache[uniformName][1] === y && this._valueCache[uniformName][2] === z)
+ return this;
+ this._cacheFloat3(uniformName, x, y, z);
+ this._engine.setFloat3(this.getUniform(uniformName), x, y, z);
+ return this;
+ };
+ Effect.prototype.setVector4 = function (uniformName, vector4) {
+ Effect.prototype.setFloat4 = function (uniformName, x, y, z, w) {
+ if (this._valueCache[uniformName] && this._valueCache[uniformName][0] === x && this._valueCache[uniformName][1] === y && this._valueCache[uniformName][2] === z && this._valueCache[uniformName][3] === w)
+ return this;
+ this._cacheFloat4(uniformName, x, y, z, w);
+ this._engine.setFloat4(this.getUniform(uniformName), x, y, z, w);
+ return this;
+ };
+ Effect.prototype.setColor3 = function (uniformName, color3) {
- SubMesh.prototype.intersects = function (ray, positions, indices, fastCheck) {
- var intersectInfo = null;
- // Triangles test
- for (var index = this.indexStart; index < this.indexStart + this.indexCount; index += 3) {
- var p0 = positions[indices[index]];
- var p1 = positions[indices[index + 1]];
- var p2 = positions[indices[index + 2]];
- var currentIntersectInfo = ray.intersectsTriangle(p0, p1, p2);
- if (currentIntersectInfo) {
- if (currentIntersectInfo.distance < 0) {
- continue;
- }
- if (fastCheck || !intersectInfo || currentIntersectInfo.distance < intersectInfo.distance) {
- intersectInfo = currentIntersectInfo;
- intersectInfo.faceId = index / 3;
- if (fastCheck) {
- break;
- }
- }
- }
- }
- return intersectInfo;
- };
- // Clone
- SubMesh.prototype.clone = function (newMesh, newRenderingMesh) {
- var result = new SubMesh(this.materialIndex, this.verticesStart, this.verticesCount, this.indexStart, this.indexCount, newMesh, newRenderingMesh, false);
- if (!this.IsGlobal) {
- result._boundingInfo = new BABYLON.BoundingInfo(this.getBoundingInfo().minimum, this.getBoundingInfo().maximum);
+ SubMesh.prototype.intersects = function (ray, positions, indices, fastCheck) {
+ var intersectInfo = null;
+ // Triangles test
+ for (var index = this.indexStart; index < this.indexStart + this.indexCount; index += 3) {
+ var p0 = positions[indices[index]];
+ var p1 = positions[indices[index + 1]];
+ var p2 = positions[indices[index + 2]];
+ var currentIntersectInfo = ray.intersectsTriangle(p0, p1, p2);
+ if (currentIntersectInfo) {
+ if (currentIntersectInfo.distance < 0) {
+ continue;
+ }
+ if (fastCheck || !intersectInfo || currentIntersectInfo.distance < intersectInfo.distance) {
+ intersectInfo = currentIntersectInfo;
+ intersectInfo.faceId = index / 3;
+ if (fastCheck) {
+ break;
+ }
+ }
+ }
+ }
+ return intersectInfo;
+ };
+ // Clone
+ SubMesh.prototype.clone = function (newMesh, newRenderingMesh) {
+ var result = new SubMesh(this.materialIndex, this.verticesStart, this.verticesCount, this.indexStart, this.indexCount, newMesh, newRenderingMesh, false);
+ if (!this.IsGlobal) {
+ result._boundingInfo = new BABYLON.BoundingInfo(this.getBoundingInfo().minimum, this.getBoundingInfo().maximum);
- CannonJSPlugin.prototype.createLink = function (mesh1, mesh2, pivot1, pivot2) {
- var body1 = null, body2 = null;
- for (var index = 0; index < this._registeredMeshes.length; index++) {
- var registeredMesh = this._registeredMeshes[index];
- if (registeredMesh.mesh === mesh1) {
- body1 = registeredMesh.body;
- }
- else if (registeredMesh.mesh === mesh2) {
- body2 = registeredMesh.body;
- }
- }
- if (!body1 || !body2) {
- return false;
- }
- var constraint = new CANNON.PointToPointConstraint(body1, new CANNON.Vec3(pivot1.x, pivot1.y, pivot1.z), body2, new CANNON.Vec3(pivot2.x, pivot2.y, pivot2.z));
- this._world.addConstraint(constraint);
- return true;
- };
- CannonJSPlugin.prototype.dispose = function () {
+ CannonJSPlugin.prototype.createLink = function (mesh1, mesh2, pivot1, pivot2) {
+ var body1 = null, body2 = null;
+ for (var index = 0; index < this._registeredMeshes.length; index++) {
+ var registeredMesh = this._registeredMeshes[index];
+ if (registeredMesh.mesh === mesh1) {
+ body1 = registeredMesh.body;
+ }
+ else if (registeredMesh.mesh === mesh2) {
+ body2 = registeredMesh.body;
+ }
+ }
+ if (!body1 || !body2) {
+ return false;
+ }
+ var constraint = new CANNON.PointToPointConstraint(body1, new CANNON.Vec3(pivot1.x, pivot1.y, pivot1.z), body2, new CANNON.Vec3(pivot2.x, pivot2.y, pivot2.z));
+ this._world.addConstraint(constraint);
+ return true;
+ };
+ CannonJSPlugin.prototype.dispose = function () {