Replies: 1 comment
-
Hi, you may be able to, but I'd need to check the source code to see if refs get reused on removing then adding obstacles. As an alternative - in the js wrapper, or in user land, we can create a unqiue id based on object identity. const objectToId = new WeakMap<any, number>()
let nextId = 0
export const id = (object: any) => {
const id = objectToId.get(object)
if (id !== undefined) return id
objectToId.set(object, nextId)
return nextId++
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi again,
You provide type
ObstacleRef
which resolves asclass dtObstacleRef {}
.However, values possess a numeric property
ptr
.Can we use this number to identity obstacles e.g. when rendering a list of them?
Beta Was this translation helpful? Give feedback.
All reactions