/// <summary> /// Construct a new MoldCastMap from a curve. /// </summary> /// <param name="raycastCurve"> /// The curve from which the rays are cast. A ray is cast out of each point on the curve. This could for /// example be the center curve of a Capsule, in which case the CurveMoldCastMap returns a height map that /// ensures that the Capsule is shaped like the moldSurface. /// </param> /// <param name="moldSurface"> /// The surface that defines the mold that shapes the height map that is returned by the MoldCastMap. Rays /// that are cast are checked whether they intersect this surface. /// </param> /// <param name="defaultRadius"> /// The height map that is returned when a ray does not intersect the moldSurface. This happens when the ray /// has missed the mold surface and shoots off to infinity. When that happens, return the length of /// defaultRadius instead, so that the heightmap is still defined. /// </param> /// <param name="direction"> /// The direction along the normal of the raycastSurface from which to cast each ray. This could either be /// outwards from the surface, or in the opposite direction. /// </param> /// <param name="maxDistance"> /// The maximum ray length before a ray is considered to be out of bounds. /// </param> public MoldCastMap(Curve raycastCurve, IRaytraceableSurface moldSurface, ContinuousMap <Vector2, float> defaultRadius, RayCastDirection direction = RayCastDirection.Outwards, float maxDistance = Single.PositiveInfinity) : this(new Capsule(raycastCurve, 0.0f), moldSurface, defaultRadius, direction, maxDistance) { }
/// <summary> /// Construct a new MoldCastMap from a curve. /// </summary> /// <param name="raycastCurve"> /// The curve from which the rays are cast. A ray is cast out of each point on the curve. This could for /// example be the center curve of a Capsule, in which case the CurveMoldCastMap returns a height map that /// ensures that the Capsule is shaped like the moldSurface. /// </param> /// <param name="moldSurface"> /// The surface that defines the mold that shapes the height map that is returned by the MoldCastMap. Rays /// that are cast are checked whether they intersect this surface. /// </param> /// <param name="defaultRadius"> /// The height map that is returned when a ray does not intersect the moldSurface. This happens when the ray /// has missed the mold surface and shoots off to infinity. When that happens, return the length of /// defaultRadius instead, so that the heightmap is still defined. /// </param> /// <param name="direction"> /// The direction along the normal of the raycastSurface from which to cast each ray. This could either be /// outwards from the surface, or in the opposite direction. /// </param> /// <param name="maxDistance"> /// The maximum ray length before a ray is considered to be out of bounds. /// </param> public MoldCastMap(Curve raycastCurve, IRaytraceableSurface moldSurface, ContinuousMap <dvec2, double> defaultRadius, RayCastDirection direction = RayCastDirection.Outwards, double maxDistance = Double.PositiveInfinity) : this(new Capsule(raycastCurve, 0.0), moldSurface, defaultRadius, direction, maxDistance) { }
/// <summary> /// Construct a new MoldCastMap. /// </summary> /// <param name="raycastSurface"> /// The surface from which the rays are cast. A ray is cast out of each point on the surface in the /// direction of the surface's normal. /// </param> /// <param name="moldSurface"> /// The surface that defines the mold that shapes the height map that is returned by the MoldCastMap. Rays /// that are cast are checked whether they intersect this surface. /// </param> /// <param name="defaultRadius"> /// The height map that is returned when a ray does not intersect the moldSurface. This happens when the ray /// has missed the mold surface and shoots off to infinity. When that happens, return the length of /// defaultRadius instead, so that the heightmap is still defined. /// </param> /// <param name="direction"> /// The direction along the normal of the raycastSurface from which to cast each ray. This could either be /// outwards from the surface, or in the opposite direction. /// </param> /// <param name="maxDistance"> /// The maximum ray length before a ray is considered to be out of bounds. /// </param> public MoldCastMap(Surface raycastSurface, IRaytraceableSurface moldSurface, ContinuousMap <Vector2, float> defaultRadius, RayCastDirection direction = RayCastDirection.Outwards, float maxDistance = Single.PositiveInfinity) { this.raycastSurface = raycastSurface; this.moldSurface = moldSurface; this.defaultRadius = defaultRadius; this.direction = direction; this.maxDistance = maxDistance; }
/// <summary> /// Construct a new MoldCastMap. /// </summary> /// <param name="raycastSurface"> /// The surface from which the rays are cast. A ray is cast out of each point on the surface in the /// direction of the surface's normal. /// </param> /// <param name="moldSurface"> /// The surface that defines the mold that shapes the height map that is returned by the MoldCastMap. Rays /// that are cast are checked whether they intersect this surface. /// </param> /// <param name="defaultRadius"> /// The height map that is returned when a ray does not intersect the moldSurface. This happens when the ray /// has missed the mold surface and shoots off to infinity. When that happens, return the length of /// defaultRadius instead, so that the heightmap is still defined. /// </param> /// <param name="direction"> /// The direction along the normal of the raycastSurface from which to cast each ray. This could either be /// outwards from the surface, or in the opposite direction. /// </param> /// <param name="maxDistance"> /// The maximum ray length before a ray is considered to be out of bounds. /// </param> public MoldCastMap(Surface raycastSurface, IRaytraceableSurface moldSurface, ContinuousMap <dvec2, double> defaultRadius, RayCastDirection direction = RayCastDirection.Outwards, double maxDistance = Double.PositiveInfinity) { this._raycastSurface = raycastSurface; this._moldSurface = moldSurface; this._defaultRadius = defaultRadius; this._direction = direction; this._maxDistance = maxDistance; }