CollisionDetection.cs 421 B

123456789101112131415161718
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using MathNet.Numerics.LinearAlgebra.Single;
  7. namespace bbiwarg.Detectors
  8. {
  9. class CollisionDetection
  10. {
  11. public static float getDistance(Vector origin, Vector normal, Vector fingerPoint)
  12. {
  13. return Math.Abs((fingerPoint - origin).DotProduct(normal));
  14. }
  15. }
  16. }