35 lines
1.7 KiB
JavaScript
35 lines
1.7 KiB
JavaScript
shadow$provide.module$node_modules$pixi_DOT_js$lib$scene$mesh_perspective$PerspectivePlaneGeometry = function(global, require, module, exports) {
|
|
global = require("module$node_modules$pixi_DOT_js$lib$scene$mesh_plane$PlaneGeometry");
|
|
var applyProjectiveTransformationToPlane = require("module$node_modules$pixi_DOT_js$lib$scene$mesh_perspective$utils$applyProjectiveTransformationToPlane"), compute2DProjections = require("module$node_modules$pixi_DOT_js$lib$scene$mesh_perspective$utils$compute2DProjections");
|
|
"use strict";
|
|
class PerspectivePlaneGeometry extends global.PlaneGeometry {
|
|
constructor(options) {
|
|
super(options);
|
|
this._projectionMatrix = [0, 0, 0, 0, 0, 0, 0, 0, 0];
|
|
const {width, height} = options;
|
|
this.corners = [0, 0, width, 0, width, height, 0, height];
|
|
}
|
|
setCorners(x0, y0, x1, y1, x2, y2, x3, y3) {
|
|
const corners = this.corners;
|
|
corners[0] = x0;
|
|
corners[1] = y0;
|
|
corners[2] = x1;
|
|
corners[3] = y1;
|
|
corners[4] = x2;
|
|
corners[5] = y2;
|
|
corners[6] = x3;
|
|
corners[7] = y3;
|
|
this.updateProjection();
|
|
}
|
|
updateProjection() {
|
|
const {width, height} = this;
|
|
var corners = this.corners;
|
|
corners = compute2DProjections.compute2DProjection(this._projectionMatrix, 0, 0, corners[0], corners[1], width, 0, corners[2], corners[3], width, height, corners[4], corners[5], 0, height, corners[6], corners[7]);
|
|
applyProjectiveTransformationToPlane.applyProjectiveTransformationToPlane(width, height, this, corners);
|
|
}
|
|
}
|
|
exports.PerspectivePlaneGeometry = PerspectivePlaneGeometry;
|
|
};
|
|
|
|
//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$scene$mesh_perspective$PerspectivePlaneGeometry.js.map
|