Пример #1
0
        // Return the inverse of this transform
        // v'=R*v+T
        // v'-T=R*v
        // inverse(R)*(v' - T) = inverse(R)*R*v = v
        // v = -inverse(R)*T +inverse(R)*(v')
        public AffineTransform inverse()
        {
            quaternion inverseQ = Missing.conjugate(q);

            return(new AffineTransform(
                       Missing.rotateVector(inverseQ, -t), inverseQ));
        }
Пример #2
0
        // returns this.Inverse() * rhs
        public AffineTransform inverseTimes(AffineTransform rhs)
        {
            quaternion inverseQ = Missing.conjugate(q);

            return(new AffineTransform(
                       Missing.rotateVector(inverseQ, rhs.t - t),
                       math.mul(inverseQ, rhs.q)));
        }
Пример #3
0
 public float3 transformDirection(float3 d)
 {
     return(Missing.rotateVector(q, d));
 }
Пример #4
0
 public float3 transform(float3 p)
 {
     return(Missing.rotateVector(q, p) + t);
 }