Skip to content

Commit

Permalink
chore(map): reduce allocations of tiny typed arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
fallenoak committed Feb 9, 2024
1 parent 3757ca7 commit d80ef81
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
],
"dependencies": {
"@tweenjs/tween.js": "^23.1.1",
"@wowserhq/format": "^0.23.0"
"@wowserhq/format": "^0.24.0"
},
"peerDependencies": {
"three": "^0.160.0"
Expand Down
6 changes: 3 additions & 3 deletions src/lib/map/loader/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ type MapSpec = {
type MapDoodadDefSpec = {
id: number;
name: string;
position: Float32Array;
rotation: Float32Array;
position: number[];
rotation: number[];
scale: number;
};

Expand Down Expand Up @@ -34,7 +34,7 @@ type TerrainGeometrySpec = {
};

type TerrainSpec = {
position: Float32Array;
position: number[];
geometry: TerrainGeometrySpec;
material: TerrainMaterialSpec;
};
Expand Down
2 changes: 1 addition & 1 deletion src/lib/map/terrain/TerrainMesh.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as THREE from 'three';

class TerrainMesh extends THREE.Mesh {
constructor(position: Float32Array, geometry: THREE.BufferGeometry, material: THREE.Material) {
constructor(position: number[], geometry: THREE.BufferGeometry, material: THREE.Material) {
super(geometry, material);

this.position.set(position[0], position[1], position[2]);
Expand Down

0 comments on commit d80ef81

Please sign in to comment.