Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
agargaro committed Sep 15, 2024
1 parent 96d42f5 commit c33b350
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 10 deletions.
9 changes: 5 additions & 4 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ export default [
...tseslint.configs.strict,
{
rules: {
'no-unused-vars': 'warn',
'no-undef': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': 'warn',
'no-unused-vars': 'off',
'no-undef': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
},
},
];
17 changes: 17 additions & 0 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@
"build": "vite build",
"clean": "npx rimraf dist",
"lint": "npx eslint --fix",
"test":"echo todo add tests",
"test": "echo todo add tests",
"publish-patch": "npm version patch --git-tag-version false && npm run build && cd dist && npm publish --access public",
"publish-minor": "npm version minor --git-tag-version false && npm run build && cd dist && npm publish --access public",
"publish-major": "npm version major --git-tag-version false && npm run build && cd dist && npm publish --access public"
},
"devDependencies": {
"@eslint/js": "^9.10.0",
"@three.ez/main": "^0.5.7",
"@types/three": "^0.167.1",
"eslint": "^9.9.0",
Expand Down
2 changes: 1 addition & 1 deletion src/objects/InstancedEntity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class InstancedEntity {
return this.matrix.premultiply(this.owner.matrixWorld);
}

constructor(owner: InstancedMesh2<any, any, any>, index: number) {
constructor(owner: InstancedMesh2, index: number) {
this.id = index;
this.owner = owner;
this.position = new Vector3();
Expand Down
2 changes: 1 addition & 1 deletion src/objects/InstancedMesh2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ export class InstancedMesh2<
}

public dispose(): this {
this.dispatchEvent<any>({ type: 'dispose' });
this.dispatchEvent<any>({ type: 'dispose' }); // TODO fix d.ts

this.matricesTexture.dispose();
this.matricesTexture = null;
Expand Down
7 changes: 4 additions & 3 deletions src/utils/createRadixSort.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Material } from "three";
import { radixSort, RadixSortOptions } from "three/examples/jsm/utils/SortUtils.js";
import { InstancedMesh2 } from "../objects/InstancedMesh2.js";
import { InstancedRenderItem } from "../objects/InstancedRenderList.js";
Expand All @@ -11,7 +12,7 @@ export function createRadixSort(target: InstancedMesh2): typeof radixSort<Instan

// https://github.com/mrdoob/three.js/blob/master/examples/webgl_mesh_batch.html#L291
return function sortFunction(list: InstancedRenderItem[]): void {
options.reversed = target.material.transparent; // TODO support multimaterial?
options.reversed = (target.material as Material).transparent; // TODO support multimaterial?

let minZ = Infinity;
let maxZ = -Infinity;
Expand All @@ -34,14 +35,14 @@ export function createRadixSort(target: InstancedMesh2): typeof radixSort<Instan

export function createRadixSort2(target: InstancedMesh2): typeof radixSort<InstancedRenderItem> {
const options: RadixSortOptions<InstancedRenderItem> = {
get: el => (el as any).depthSort,
get: el => (el as any).depthSort, //TODO check any
aux: new Array(target.maxCount), //TODO check array and typed array
reversed: null
};

// https://github.com/mrdoob/three.js/blob/master/examples/webgl_mesh_batch.html#L291
return function sortFunction(list: InstancedRenderItem[]): void {
options.reversed = target.material.transparent; // TODO support multimaterial?
options.reversed = (target.material as Material).transparent; // TODO support multimaterial?

let minZ = Infinity;
let maxZ = -Infinity;
Expand Down

0 comments on commit c33b350

Please sign in to comment.