AGENTS.md
This commit is contained in:
parent
087c8b32c3
commit
b701059c8c
7 changed files with 331 additions and 62 deletions
|
|
@ -1366,12 +1366,13 @@ namespace Crafter {
|
|||
return v + t * q.template Shuffle<{{3,3,3,3}}>() + Cross(qv, t);
|
||||
}
|
||||
|
||||
constexpr static VectorF32<4, 2> RotatePivot(VectorF32<3, Packing> v, VectorF32<4, Packing> q, VectorF32<3, Packing> pivot) requires(Len == 3) {
|
||||
VectorF32<Len, Packing> translated = v - pivot;
|
||||
VectorF32<3, Packing> qv(q.v);
|
||||
VectorF32<Len, Packing> t = Cross(qv, translated) * float(2);
|
||||
VectorF32<Len, Packing> rotated = translated + t * q.template Shuffle<{{3,3,3,3}}>() + Cross(qv, t);
|
||||
return rotated + pivot;
|
||||
// Through Rotate, like the other backends: it repacks the quaternion's
|
||||
// xyz lanes into the 3-vector layout. This used to repeat Rotate's
|
||||
// arithmetic with the register taken as is (qv(q.v)), which only lines
|
||||
// up for Packing 1, and to return a VectorF32<4, 2> whatever the shape.
|
||||
constexpr static VectorF32<3, Packing> RotatePivot(VectorF32<3, Packing> v, VectorF32<4, Packing> q, VectorF32<3, Packing> pivot) requires(Len == 3) {
|
||||
VectorF32<3, Packing> translated = v - pivot;
|
||||
return Rotate(translated, q) + pivot;
|
||||
}
|
||||
|
||||
constexpr static VectorF32<4, Packing> QuanternionFromEuler(VectorF32<3, Packing> EulerHalf) requires(Len == 4) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue