更新编译输出为es5支持老旧的浏览器

This commit is contained in:
ChenX
2018-06-06 17:23:22 +08:00
parent 256a7ea8a6
commit 29a6dd0fff
38 changed files with 616 additions and 533 deletions

44
dist/PlaneExt.js vendored
View File

@@ -1,16 +1,27 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
const THREE = require("three");
const three_1 = require("three");
class PlaneExt extends THREE.Plane {
constructor(normal, constant) {
super(normal, constant);
var THREE = require("three");
var three_1 = require("three");
var PlaneExt = /** @class */ (function (_super) {
__extends(PlaneExt, _super);
function PlaneExt(normal, constant) {
return _super.call(this, normal, constant) || this;
}
intersectLine(line, optionalTarget, extendLine) {
let v1 = new three_1.Vector3();
let result = optionalTarget || new three_1.Vector3();
let direction = line.delta(v1);
let denominator = this.normal.dot(direction);
PlaneExt.prototype.intersectLine = function (line, optionalTarget, extendLine) {
var v1 = new three_1.Vector3();
var result = optionalTarget || new three_1.Vector3();
var direction = line.delta(v1);
var denominator = this.normal.dot(direction);
if (denominator === 0) {
// line is coplanar, return origin
if (this.distanceToPoint(line.start) === 0) {
@@ -19,18 +30,19 @@ class PlaneExt extends THREE.Plane {
// Unsure if this is the correct method to handle this case.
return undefined;
}
let t = -(line.start.dot(this.normal) + this.constant) / denominator;
var t = -(line.start.dot(this.normal) + this.constant) / denominator;
//If you not extendLine,check intersect point in Line
if (!extendLine && (t < 0 || t > 1)) {
return undefined;
}
return result.copy(direction).multiplyScalar(t).add(line.start);
}
intersectRay(ray, optionalTarget, extendLine) {
};
PlaneExt.prototype.intersectRay = function (ray, optionalTarget, extendLine) {
// 从射线初始位置
let line = new THREE.Line3(ray.origin.clone(), ray.origin.clone().add(ray.direction));
var line = new THREE.Line3(ray.origin.clone(), ray.origin.clone().add(ray.direction));
return this.intersectLine(line, optionalTarget, extendLine);
}
}
};
return PlaneExt;
}(THREE.Plane));
exports.PlaneExt = PlaneExt;
//# sourceMappingURL=PlaneExt.js.map