Esempio n. 1
0
        /// <summary>
        /// Constructor (Named) - The intersection of two spheres is a circle, and adding a third sphere generates a set of colliders that define an arc
        /// </summary>
        /// <param name="arc">The arc for which the colliders will be generated.</param>
        /// <returns>A set of three Spheres that define an arc collision.</returns>
        public static PlanetariaArcCollider block(Arc arc)
        {
            if (arc.type == ArcType.ConcaveCorner)
            {
                return(new PlanetariaArcCollider(PlanetariaSphereCollider.never, PlanetariaSphereCollider.never,
                                                 PlanetariaSphereCollider.never));
            }
            PlanetariaSphereCollider boundary_collider = PlanetariaArcColliderUtility.boundary_collider(arc);

            PlanetariaSphereCollider[] elevation_colliders = PlanetariaArcColliderUtility.elevation_collider(arc.floor());
            return(new PlanetariaArcCollider(elevation_colliders[0], boundary_collider, elevation_colliders[1]));
        }
Esempio n. 2
0
 /// <summary>
 /// Constructor (Named) - Finds a Sphere that include "point" at the boundary and has a center along "center_axis"
 /// </summary>
 /// <param name="center_axis">The axis of the center point. The resulting center point (in return value) may vary.</param>
 /// <param name="point">The furthest point to include.</param>
 /// <returns>A sphere centered along "center_axis" and including "point" at its boundary.</returns>
 public static PlanetariaSphereCollider boundary(Vector3 center_axis, Vector3 point)
 {
     return(PlanetariaArcColliderUtility.boundary_collider(center_axis, point));
 }