Skip to content

Conversation

@Brakebein
Copy link
Contributor

BatchTable is exported in the types .d.ts, however not in the .js files. I offload some computation in a web worker, where I need to re-instantiate the BatchTable, which I can only do if it is properly exported. I also added some other types to the BatchTable/FeatureTable that are necessary for instantiation.

I also saw that TraversalUtils and LoaderUtils are exported in the .js files, but not as types. So I added some types here as well.

Also adding clock in EnvironmentControls.d.ts.

Copy link
Contributor

@gkjohnson gkjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I added a few comments - I think it's best to keep the changes limited to BatchedMesh here if that's what you need.

I offload some computation in a web worker, where I need to re-instantiate the BatchTable, which I can only do if it is properly exported.

I'm curious to hear more about this. Are you seeing meaningful performance benefits? Which file formats are you using? Which bottlenecks is this helping with?

fallbackPlane: Plane;
up: Vector3;
pivotPoint: Vector3;
clock: Clock;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally I'm only adding types for features I intend to be accessed by a user - basically the "public" API. So I'd prefer to keep the clock variable excluded here.

Comment on lines +15 to +16
export * as TraversalUtils from './utilities/TraversalUtils.js';
export * as LoaderUtils from './utilities/LoaderUtils.js';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are also not documented nor intended to be user-accessible. They're exported so they can be used in plugins, etc. I'm hesitant to make them public because I'm not prepared to consider these part of the API and document things like breaking changes.

@gkjohnson gkjohnson added this to the v0.4.20 milestone Jan 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants