You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using 3rd party libraries (e.g. physics) it's a little bit cumbersome to work with Vector3 and Quaternion etc. Library often gives back a vector like object, but you cannot use it directly.
// Get position from physics worldconstposition=rigidBody.position()// { x: number, y: number, z: number }// Set object3d's position, but not allowed since `position` isn't a `Vector3`object3d.position.copy(position)
So you need to either create a new Vector3 or set the x/y/z individually like this
A potential issue with this is that you'd have to be sure there are no further operations in the method. For example if it's using set(x, y, z) and the z is undefined. That is if there are mismatched dimensions. I think the concern still stands in that it must not have any methods called.
Describe the feature you'd like:
When using 3rd party libraries (e.g. physics) it's a little bit cumbersome to work with
Vector3
andQuaternion
etc. Library often gives back a vector like object, but you cannot use it directly.So you need to either create a new
Vector3
or set thex/y/z
individually like thisSuggested implementation:
This could be solved by adding
*Like
interfaces and accepting it where it makes sense. Not sure if this has any unintended side effects thoughThe text was updated successfully, but these errors were encountered: