Esempio n. 1
0
        public Ray Transform(RtMatrix tranformation)
        {
            var newOrigin    = tranformation * Origin;
            var newDirection = tranformation * Direction;

            return(new Ray(newOrigin, newDirection));
        }
Esempio n. 2
0
        public RtMatrix Inverse()
        {
            if (_inverseMatrix != RtMatrix.Identity)
            {
                return(_inverseMatrix);
            }

            _inverseMatrix = Matrix.Inverse();

            return(_inverseMatrix);
        }
Esempio n. 3
0
        public RtVector NormalToWorld(RtVector normal)
        {
            normal = RtMatrix.Transpose(Transform.Inverse()) * normal;
            normal = normal.Normalize();

            if (Parent != null)
            {
                normal = Parent.NormalToWorld(normal);
            }

            return(normal);
        }
Esempio n. 4
0
 public Transform(RtMatrix matrix)
 {
     Matrix = matrix;
 }
Esempio n. 5
0
 public bool Equals(RtMatrix other)
 {
     return(Matrix.Equals(other));
 }