Skip to content

Meaning of index parameter in hook function signature #121

Answered by stockhuman
mattrossman asked this question in Q&A
Discussion options

You must be logged in to vote

Better late than never?

You'll find your answer on L183 of hooks.ts:

props = uuid.map((id, i) => {
  const props = prepare(temp, fn(i), argFn) // here, fn is the x-Fn you mentioned
  temp.updateMatrix()
  object.setMatrixAt(i, temp.matrix)
  object.instanceMatrix.needsUpdate = true
  return props
})

It's a UUID index, used to iterate over every body in the scene.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by stockhuman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants