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
Originally posted by dataphract October 31, 2022
In collision detection, it's often useful to perform computations in the local space of one of the involved objects.
For instance, given an OBB:
structObb{half_extents:Vec3,orientation:Vec3,}
the closest point within the OBB to another point can be found like so:
other is converted to the local space of self by premultiplying by the inverse of self.orientation, and since self.orientation is an orthonormal basis, its inverse is equivalent to its transpose. However, it's not necessary to actually construct the transposed matrix -- the multiplication can be performed by dotting the columns of the left-hand side with the columns of the right.
Ideally, we could instead write:
implObb{fnclosest(&self,other:Vec3) -> Vec3{let local_other = self.orientation.mul_transpose(other);// or transpose_mul(), if you likeself.orientation* local_other.clamp(-self.half_extents,self.half_extents)}}
```</div>
The text was updated successfully, but these errors were encountered:
Discussed in #358
Originally posted by dataphract October 31, 2022
In collision detection, it's often useful to perform computations in the local space of one of the involved objects.
For instance, given an OBB:
the closest point within the OBB to another point can be found like so:
other
is converted to the local space ofself
by premultiplying by the inverse ofself.orientation
, and sinceself.orientation
is an orthonormal basis, its inverse is equivalent to its transpose. However, it's not necessary to actually construct the transposed matrix -- the multiplication can be performed by dotting the columns of the left-hand side with the columns of the right.Ideally, we could instead write:
The text was updated successfully, but these errors were encountered: