コード例 #1
0
ファイル: Core.cs プロジェクト: RodroVMS/teachingCG
        /// <summary>
        /// Determines whenever a specific position is inside the volume.
        /// </summary>
        public static bool IsInside(this IVolume volume, float3 x)
        {
            var hits = volume.Raycast(x, Gfx.normalize(new float3(3.001f, 5.003f, 7.021f)));

            return(hits.Length % 2 == 1);
        }
コード例 #2
0
 /// <summary>
 /// Creates a ray that goes from a in direction to b
 /// </summary>
 public static Ray3D CreateFromTo(float3 a, float3 b)
 {
     return(new Ray3D(a, Gfx.normalize(b - a)));
 }