Skip to content

Conversation

@DTCurrie DTCurrie self-assigned this Dec 19, 2025
@changeset-bot
Copy link

changeset-bot bot commented Dec 19, 2025

⚠️ No Changeset found

Latest commit: 4b3989e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

/**
* Control points buffer: [x, y, z, ox, oy, oz, theta, ...]
*/
export const ControlPoints = trait(() => new Uint8Array(0))
Copy link
Member

Choose a reason for hiding this comment

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

the control points, knots, weights and degree is a very specific nurb thing, is it possible we create a single nurb trait with these props instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I considered it. I am also open to just dropping nurbs for now. I realized the control points are poses but I think we actually could just use positions and use that trait instead. But also not sure how much value there is in supporting nurbs at this exact moment.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd recommend we convert the nurbs into a LineGeometry before it ever hits a trait

Copy link
Collaborator

Choose a reason for hiding this comment

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

There's no value in keeping the nurbs definition in the traits themselves

Copy link
Collaborator

Choose a reason for hiding this comment

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

There's no value in keeping the nurbs definition in the traits themselves

*/
export const ColorsRGBA = trait(() => new Uint8Array(0) as Uint8Array<ArrayBufferLike>)

export const MimeType = trait(() => '')
Copy link
Member

Choose a reason for hiding this comment

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

also wondering about these traits too since they will only be used for models, would maybe be good to keep them in a singular trait so they are always packed together and an entity cannot have one but not the others

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah I was thinking I could see a world where they could be used elsewhere, but open to reducing them for now.

Copy link
Member

@mattmacf98 mattmacf98 Dec 22, 2025

Choose a reason for hiding this comment

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

@micheal-parks so we are keeping these as individual traits?

nvm you beat me too it with the update

* RGBA colors buffer: [r, g, b, a, ...] as uint8 (0-255)
* Can be single color or per-vertex colors.
*/
export const ColorsRGBA = trait(() => new Uint8Array(0) as Uint8Array<ArrayBufferLike>)
Copy link
Collaborator

Choose a reason for hiding this comment

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

There's already a VertexColors and Opacity trait that covers this

/**
* Packed poses (sans-theta) buffer: [x, y, z, ox, oy, oz, ...]
*/
export const Arrows = trait(() => new Uint8Array(0))
Copy link
Collaborator

Choose a reason for hiding this comment

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

We shouldn't be stuffing binaries into traits, and by the time that we're at an ECS each object should have its own entity, so we should instead be putting this information into the Pose trait

/**
* Packed positions buffer: [x, y, z, ...]
*/
export const Positions = trait(() => new Uint8Array(0))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same situation here, this information should be fed into the pose trait

Base automatically changed from snapshot-component_add-buffer-utils to main December 22, 2025 16:46
export const LineGeometry = trait(() => [] as Vector3[])
export const PointsGeometry = trait(() => new Float32Array())
/** format [x, y, z, ...] */
export const LinePositions = trait(() => new Float32Array())
Copy link
Member

Choose a reason for hiding this comment

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

why even have separate traits for the line and point positions now?

*/
export const ColorsRGBA = trait(() => new Uint8Array(0) as Uint8Array<ArrayBufferLike>)

export const MimeType = trait(() => '')
Copy link
Member

@mattmacf98 mattmacf98 Dec 22, 2025

Choose a reason for hiding this comment

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

@micheal-parks so we are keeping these as individual traits?

nvm you beat me too it with the update


{@render children?.()}
</InstancedMesh>
{#if dotColor.current && linePositions.current}
Copy link
Member

Choose a reason for hiding this comment

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

nit can we update to point color to stay consistent to the api naming

@micheal-parks micheal-parks merged commit 728b557 into main Dec 22, 2025
4 checks passed
@micheal-parks micheal-parks deleted the snapshot-component_add-traits branch December 22, 2025 18:25
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.

4 participants