MCPcopy Create free account
hub / github.com/melonjs/melonJS / buildPyramidSettings

Function buildPyramidSettings

packages/melonjs/tests/mesh.spec.js:1026–1053  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1024 // 12-vertex / 4-triangle pyramid as a minimal raw-data Mesh. Keeps
1025 // the test isolated from the OBJ + MTL loader.
1026 function buildPyramidSettings() {
1027 return {
1028 vertices: new Float32Array([
1029 // apex
1030 0, 1, 0,
1031 // base
1032 -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1,
1033 ]),
1034 uvs: new Float32Array([0.5, 0, 0, 1, 1, 1, 1, 1, 0, 1]),
1035 indices: new Uint16Array([
1036 0,
1037 1,
1038 2,
1039 0,
1040 2,
1041 3,
1042 0,
1043 3,
1044 4,
1045 0,
1046 4,
1047 1, // sides
1048 ]),
1049 width: 60,
1050 height: 60,
1051 cullBackFaces: true,
1052 };
1053 }
1054
1055 it("activation under Camera3d marks the mesh for world-space draw", () => {
1056 const m = new Mesh(0, 0, buildPyramidSettings());

Callers 2

mesh.spec.jsFile · 0.85
litPyramidFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected