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
in the vec3 and quat helper utils the .jolt methods make sure no matter what type of input object you pass it automatically creates/converts it to a Jolt object. (anyVec & anyQuat)
For Tuples and ThreeJS objects it's understood that this will create a new Jolt object that must be destroyed.
However, if you pass a Jolt object to this function it will simply return the original function.
Consider:
constposition=useLocal? SomeThreeJSBody.position|SomeJoltBody.GetPosition();// this is a reference either wayconstnewPosition=vec3.jolt(position);myObject.position=newPosition;Raw.module.destroy(newPosition);// proper cleanup
If it's a threeJS object you put in, it will work fine, create a new Jolt item and be destroyed cleanly.
HOWEVER, if you passed the Jolt object, it will pass the ORIGINAL which in this case is a reference.
When you destroy that reference, stuff will break...
And you 100% will never be able to track it down because it's probably a memory corruption error that's throwing out of bounds error on some totally unrelated task.
Unfortunately jolt doesn't have a clone method which is annoying, especially for quaternions.
Probably should just add a .clone() method to both vec3 and quat
This isn't blocking anything right this minute so I just want to track that this fix needs to be done
The text was updated successfully, but these errors were encountered:
in the
vec3
andquat
helper utils the.jolt
methods make sure no matter what type of input object you pass it automatically creates/converts it to a Jolt object. (anyVec
&anyQuat
)For Tuples and ThreeJS objects it's understood that this will create a new Jolt object that must be destroyed.
However, if you pass a Jolt object to this function it will simply return the original function.
Consider:
If it's a threeJS object you put in, it will work fine, create a new Jolt item and be destroyed cleanly.
HOWEVER, if you passed the Jolt object, it will pass the ORIGINAL which in this case is a reference.
When you destroy that reference, stuff will break...
And you 100% will never be able to track it down because it's probably a memory corruption error that's throwing out of bounds error on some totally unrelated task.
Unfortunately jolt doesn't have a clone method which is annoying, especially for quaternions.
Probably should just add a
.clone()
method to bothvec3
andquat
This isn't blocking anything right this minute so I just want to track that this fix needs to be done
The text was updated successfully, but these errors were encountered: