sdfsdfs
This commit is contained in:
37
node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildTriangle.mjs
generated
vendored
Normal file
37
node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildTriangle.mjs
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
import { ExtensionType } from '../../../../extensions/Extensions.mjs';
|
||||
|
||||
"use strict";
|
||||
const buildTriangle = {
|
||||
extension: {
|
||||
type: ExtensionType.ShapeBuilder,
|
||||
name: "triangle"
|
||||
},
|
||||
build(shape, points) {
|
||||
points[0] = shape.x;
|
||||
points[1] = shape.y;
|
||||
points[2] = shape.x2;
|
||||
points[3] = shape.y2;
|
||||
points[4] = shape.x3;
|
||||
points[5] = shape.y3;
|
||||
return points;
|
||||
},
|
||||
triangulate(points, vertices, verticesStride, verticesOffset, indices, indicesOffset) {
|
||||
let count = 0;
|
||||
verticesOffset *= verticesStride;
|
||||
vertices[verticesOffset + count] = points[0];
|
||||
vertices[verticesOffset + count + 1] = points[1];
|
||||
count += verticesStride;
|
||||
vertices[verticesOffset + count] = points[2];
|
||||
vertices[verticesOffset + count + 1] = points[3];
|
||||
count += verticesStride;
|
||||
vertices[verticesOffset + count] = points[4];
|
||||
vertices[verticesOffset + count + 1] = points[5];
|
||||
const verticesIndex = verticesOffset / verticesStride;
|
||||
indices[indicesOffset++] = verticesIndex;
|
||||
indices[indicesOffset++] = verticesIndex + 1;
|
||||
indices[indicesOffset++] = verticesIndex + 2;
|
||||
}
|
||||
};
|
||||
|
||||
export { buildTriangle };
|
||||
//# sourceMappingURL=buildTriangle.mjs.map
|
Reference in New Issue
Block a user