simulationjsv2 0.10.5 → 0.10.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/buffers.d.ts +0 -1
- package/dist/globals.d.ts +0 -1
- package/dist/graphics.d.ts +5 -6
- package/dist/graphics.js +1 -1
- package/dist/internalUtils.d.ts +1 -2
- package/dist/shaders.d.ts +0 -1
- package/dist/types.d.ts +0 -1
- package/dist/utils.d.ts +0 -1
- package/package.json +1 -1
- package/pnpm-workspace.yaml +2 -0
package/README.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
SimulationJS is a graphics library with simple easy to use APIs. Version 2 hopes to improve 3d graphics and boost performance by using webgpu under the hood.
|
|
4
4
|
|
|
5
|
+
Watch a quick demo
|
|
6
|
+
|
|
7
|
+
[](https://www.youtube.com/watch?v=RkgLstvSNGI)
|
|
8
|
+
|
|
5
9
|
**Documentation at 1.0.0**
|
|
6
10
|
|
|
7
11
|
By _Jackson Otto_
|
package/dist/buffers.d.ts
CHANGED
package/dist/globals.d.ts
CHANGED
package/dist/graphics.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="@webgpu/types" />
|
|
2
1
|
import type { Vector2, Vector3, LerpFunc, Mat4 } from './types.js';
|
|
3
2
|
import { Vertex, Color } from './utils.js';
|
|
4
3
|
import { BlankGeometry, CircleGeometry, CubeGeometry, Geometry, Line2dGeometry, Line3dGeometry, PlaneGeometry, PolygonGeometry, Spline2dGeometry, SquareGeometry, TraceLinesGeometry as TraceLinesGeometry } from './geometry.js';
|
|
@@ -82,8 +81,8 @@ export declare abstract class SimulationElement3d {
|
|
|
82
81
|
getTreeVertexCount(): number;
|
|
83
82
|
getIndexCount(): number;
|
|
84
83
|
writeBuffers(): void;
|
|
85
|
-
getVertexBuffer(): Float32Array
|
|
86
|
-
getIndexBuffer(): Uint32Array
|
|
84
|
+
getVertexBuffer(): Float32Array<ArrayBufferLike>;
|
|
85
|
+
getIndexBuffer(): Uint32Array<ArrayBuffer>;
|
|
87
86
|
}
|
|
88
87
|
export declare class EmptyElement extends SimulationElement3d {
|
|
89
88
|
protected geometry: BlankGeometry;
|
|
@@ -208,7 +207,7 @@ export declare class Spline2d extends SimulationElement2d {
|
|
|
208
207
|
private length;
|
|
209
208
|
constructor(pos: Vertex, points: SplinePoint2d[], thickness?: number, detail?: number);
|
|
210
209
|
private setVertexColors;
|
|
211
|
-
getVertexBuffer(): Float32Array
|
|
210
|
+
getVertexBuffer(): Float32Array<ArrayBufferLike>;
|
|
212
211
|
isTransparent(): boolean;
|
|
213
212
|
private estimateLength;
|
|
214
213
|
getLength(): number;
|
|
@@ -239,8 +238,8 @@ export declare class Instance<T extends SimulationElement3d> extends SimulationE
|
|
|
239
238
|
getTreeVertexCount(): number;
|
|
240
239
|
getIndexCount(): number;
|
|
241
240
|
getGeometryTopology(): "list" | "strip";
|
|
242
|
-
getVertexBuffer(): Float32Array
|
|
243
|
-
getIndexBuffer(): Uint32Array
|
|
241
|
+
getVertexBuffer(): Float32Array<ArrayBufferLike>;
|
|
242
|
+
getIndexBuffer(): Uint32Array<ArrayBuffer>;
|
|
244
243
|
getModelMatrix(): Mat4;
|
|
245
244
|
}
|
|
246
245
|
export declare class TraceLines2d extends SimulationElement2d {
|
package/dist/graphics.js
CHANGED
|
@@ -165,7 +165,7 @@ export class SimulationElement3d {
|
|
|
165
165
|
const mat = this.getModelMatrix();
|
|
166
166
|
const device = globalInfo.errorGetDevice();
|
|
167
167
|
const buffer = this.uniformBuffer.getBuffer();
|
|
168
|
-
device.queue.writeBuffer(buffer, modelProjMatOffset, mat);
|
|
168
|
+
device.queue.writeBuffer(buffer, modelProjMatOffset, mat.buffer);
|
|
169
169
|
return buffer;
|
|
170
170
|
}
|
|
171
171
|
getPipeline() {
|
package/dist/internalUtils.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="@webgpu/types" />
|
|
2
1
|
import { Mat4, Vector3 } from './types.js';
|
|
3
2
|
import { Shader } from './shaders.js';
|
|
4
3
|
import { SimulationElement3d } from './graphics.js';
|
|
@@ -7,7 +6,7 @@ export declare class Float32ArrayCache {
|
|
|
7
6
|
private hasUpdated;
|
|
8
7
|
constructor();
|
|
9
8
|
setCache(vertices: Float32Array | number[]): void;
|
|
10
|
-
getCache(): Float32Array
|
|
9
|
+
getCache(): Float32Array<ArrayBufferLike>;
|
|
11
10
|
updated(): void;
|
|
12
11
|
shouldUpdate(): boolean;
|
|
13
12
|
getVertexCount(stride?: number): number;
|
package/dist/shaders.d.ts
CHANGED
package/dist/types.d.ts
CHANGED
package/dist/utils.d.ts
CHANGED
package/package.json
CHANGED