public Ray Transform(RtMatrix tranformation) { var newOrigin = tranformation * Origin; var newDirection = tranformation * Direction; return(new Ray(newOrigin, newDirection)); }
public RtMatrix Inverse() { if (_inverseMatrix != RtMatrix.Identity) { return(_inverseMatrix); } _inverseMatrix = Matrix.Inverse(); return(_inverseMatrix); }
public RtVector NormalToWorld(RtVector normal) { normal = RtMatrix.Transpose(Transform.Inverse()) * normal; normal = normal.Normalize(); if (Parent != null) { normal = Parent.NormalToWorld(normal); } return(normal); }
public Transform(RtMatrix matrix) { Matrix = matrix; }
public bool Equals(RtMatrix other) { return(Matrix.Equals(other)); }