Beispiel #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));
        }
Beispiel #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)));
        }
Beispiel #3
0
 public float3 transformDirection(float3 d)
 {
     return(Missing.rotateVector(q, d));
 }
Beispiel #4
0
 public float3 transform(float3 p)
 {
     return(Missing.rotateVector(q, p) + t);
 }