Example #1
0
        /// <inheritdoc />
        public override float GetValueAt(Vector2 uv)
        {
            float directionSign = (direction == RayCastDirection.Outwards) ? 1.0f : -1.0f;

            Ray   ray = new Ray(raycastSurface.GetPositionAt(uv), directionSign * Vector3.Normalize(raycastSurface.GetNormalAt(uv)));
            float intersectionRadius = moldSurface.RayIntersect(ray);

            if (Math.Abs(intersectionRadius) <= maxDistance)
            {
                return(intersectionRadius);
            }
            else
            {
                return(defaultRadius.GetValueAt(uv));
            }
        }
Example #2
0
        /// <inheritdoc />
        public override double GetValueAt(dvec2 uv)
        {
            DebugUtil.AssertAllFinite(uv, nameof(uv));
            double directionSign = (direction == RayCastDirection.Outwards) ? 1.0 : -1.0;

            Ray    ray = new Ray(raycastSurface.GetPositionAt(uv), directionSign * raycastSurface.GetNormalAt(uv).Normalized);
            double intersectionRadius = moldSurface.RayIntersect(ray);

            if (Math.Abs(intersectionRadius) <= maxDistance)
            {
                return(intersectionRadius);
            }
            else
            {
                return(defaultRadius.GetValueAt(uv));
            }
        }
Example #3
0
 /// <summary>
 /// Gets a value from the second continuous map this object was constructed with by giving it the output of
 /// the first map, which is given the input to this function. Composes functions.
 /// </summary>
 /// <param name="t">Value to give to first map.</param>
 /// <returns>Value of second map at the first map's value for t.</returns>
 public override TOut GetValueAt(TIn t) => _right.GetValueAt(_left.GetValueAt(t));