-
Notifications
You must be signed in to change notification settings - Fork 1
App 15105 create entity relationships #379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 5c46a77 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
| const y = positions[i + 1] / 1000 | ||
| const z = positions[i + 2] / 1000 | ||
|
|
||
| const distance = point.distanceToSquared(new Vector3(x, y, z)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should use a pooled vector
| const distance = point.distanceToSquared(new Vector3(x, y, z)) | |
| const distance = point.distanceToSquared(vec3.set(x, y, z)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok yeah will update
| y: number | ||
| z: number | ||
| } | ||
| orientation?: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| orientation?: { | |
| direction?: { |
since this isn't a true orientation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will update
| y: 0, // World position Y in meters | ||
| z: 0, // World position Z in meters | ||
| }) | ||
| export const Hover = trait(() => ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd maybe call this trait "InstancedPose" instead, since that's what it represents (an arrow instance, a point instance within THREE.Points, other instance types in the future?). Memory layout could also be made more efficient (struct of arrays):
export const InstancedPose = trait({
x: 0, y: 0, z: 0, ox: 0, oY: 0, oZ: 1, theta: 0, index: -1
})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok yeah i can update that
| provideFramelessComponents() | ||
|
|
||
| const { focus } = provideSelection() | ||
| provideHoveredLinkedEntities() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe leave hovered out of the naming for all of the new introductions that involve linking?
provideLinkedEntities()
While it's true that right now that linking is visually represented only during hovering, it's totally possible in the near future this might change or other types visual feedback for linking could be introduced
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok yeah I can remove the hovered naming for this relationship context
| import { Parser } from 'expr-eval' | ||
| import { useTrait } from '$lib/ecs' | ||
|
|
||
| const parser = new Parser() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can probably move this to a <script module> section to avoid new parsers per entity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
|
||
| const displayedHoverInfo = useTrait(() => displayEntity, traits.Hover) | ||
|
|
||
| let hoverInfo: HoverInfo | null = $state.raw(null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| let hoverInfo: HoverInfo | null = $state.raw(null) | |
| let hoverInfo= $state.raw<HoverInfo | null>(null) |
just slightly more typesafe :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
Description
This PR creates the first koota relationship for our entities and creates a hover link entity which enables directional index mapping for hover actions.
Testing
Screen.Recording.2026-02-09.at.2.mp4