Move a few things around
- common files to a new 'wmc-common' package in common/ - skycraft now puts all serving files into static/
This commit is contained in:
parent
9bb162e7d5
commit
33733c6fe4
8
common/package.json
Normal file
8
common/package.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "wmc-common",
|
||||
"version": "1.0.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"esbuild": "^0.14.2"
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
import { makeFace } from '../geometry';
|
||||
import { makeFace } from 'wmc-common/geometry';
|
||||
import * as linalg from './linalg';
|
||||
import {memoize} from '../memoize';
|
||||
import {memoize} from 'wmc-common/memoize';
|
||||
|
||||
type direction = ('-x' | '+x' | '-y' | '+y' | '-z' | '+z');
|
||||
|
||||
@ -310,4 +310,4 @@ export function getBodyGeometry(seed: number) {
|
||||
.map(chunk => [...makeChunkFaces(chunk)]);
|
||||
|
||||
return faces.reduce((a, b) => a.concat(b));
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {makeBufferFromFaces } from '../geometry';
|
||||
import { loadTexture, makeProgram } from '../gl';
|
||||
import {makeBufferFromFaces } from 'wmc-common/geometry';
|
||||
import { loadTexture, makeProgram } from 'wmc-common/gl';
|
||||
import * as linalg from './linalg';
|
||||
import * as se3 from '../se3';
|
||||
import * as se3 from 'wmc-common/se3';
|
||||
import { makeOrbitObject } from './orbit';
|
||||
|
||||
const VSHADER = `
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { makeFace } from '../geometry';
|
||||
import { makeFace } from 'wmc-common/geometry';
|
||||
|
||||
import * as linalg from './linalg';
|
||||
import { loadObjModel } from './obj';
|
||||
import * as se3 from '../se3';
|
||||
import * as se3 from 'wmc-common/se3';
|
||||
import { computeOrbit, findSoi, getCartesianState, updateBodyPhysics } from './orbit';
|
||||
import { getBodyGeometry } from './chunk';
|
||||
import { draw, getOrbitDrawContext, initWorldGl } from './draw';
|
||||
@ -406,4 +406,4 @@ async function main() {
|
||||
requestAnimationFrame(time => tick(time, context));
|
||||
}
|
||||
|
||||
window.onload = main;
|
||||
window.onload = main;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as se3 from '../se3';
|
||||
import * as se3 from 'wmc-common/se3';
|
||||
import * as linalg from './linalg';
|
||||
import {Vec3} from './linalg';
|
||||
|
||||
@ -277,4 +277,4 @@ export function makeOrbitObject(gl: WebGLRenderingContext, glContext: any, orbit
|
||||
position,
|
||||
glContext,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -4,11 +4,12 @@
|
||||
"main": "index.ts",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"esbuild": "^0.14.2"
|
||||
"esbuild": "^0.14.2",
|
||||
"wmc-common": "link:../common"
|
||||
},
|
||||
"scripts": {
|
||||
"watch": "esbuild --outfile=app.js index.ts --bundle --sourcemap=inline --watch",
|
||||
"serve": "esbuild --outfile=app.js index.ts --bundle --sourcemap=inline --servedir=.",
|
||||
"watch": "esbuild --outfile=static/app.js index.ts --bundle --sourcemap=inline --watch",
|
||||
"serve": "esbuild --outfile=static/app.js index.ts --bundle --sourcemap=inline --servedir=static",
|
||||
"build": "esbuild --outfile=app.js index.ts --bundle --minify"
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {Mat4} from './linalg';
|
||||
import * as se3 from '../se3';
|
||||
import * as se3 from 'wmc-common/se3';
|
||||
|
||||
export interface Quat {
|
||||
x: number,
|
||||
@ -121,4 +121,4 @@ export function scale(q: Quat, a: number): Quat {
|
||||
z: a * q.z,
|
||||
w: a * q.w,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
BIN
skycraft/static/texture.png
Normal file
BIN
skycraft/static/texture.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 40 KiB |
@ -1 +0,0 @@
|
||||
../texture.png
|
@ -44,7 +44,7 @@ esbuild-linux-32@0.14.54:
|
||||
|
||||
esbuild-linux-64@0.14.54:
|
||||
version "0.14.54"
|
||||
resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.14.54.tgz#de5fdba1c95666cf72369f52b40b03be71226652"
|
||||
resolved "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.54.tgz"
|
||||
integrity sha512-EgjAgH5HwTbtNsTqQOXWApBaPVdDn7XcK+/PtJwZLT1UmpLoznPd8c5CxqsH2dQK3j05YsB3L17T8vE7cp4cCg==
|
||||
|
||||
esbuild-linux-arm64@0.14.54:
|
||||
@ -109,7 +109,7 @@ esbuild-windows-arm64@0.14.54:
|
||||
|
||||
esbuild@^0.14.2:
|
||||
version "0.14.54"
|
||||
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.14.54.tgz#8b44dcf2b0f1a66fc22459943dccf477535e9aa2"
|
||||
resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.14.54.tgz"
|
||||
integrity sha512-Cy9llcy8DvET5uznocPyqL3BFRrFXSVqbgpMJ9Wz8oVjZlh/zUSNbPRbov0VX7VxN2JH1Oa0uNxZ7eLRb62pJA==
|
||||
optionalDependencies:
|
||||
"@esbuild/linux-loong64" "0.14.54"
|
||||
@ -133,3 +133,7 @@ esbuild@^0.14.2:
|
||||
esbuild-windows-32 "0.14.54"
|
||||
esbuild-windows-64 "0.14.54"
|
||||
esbuild-windows-arm64 "0.14.54"
|
||||
|
||||
"wmc-common@link:../common":
|
||||
version "0.0.0"
|
||||
uid ""
|
||||
|
Loading…
Reference in New Issue
Block a user