Example #1
0
        bool FindObstacle(Vector3 facingDir, out GenericCastHit firstHit)
        {
            facingDir = rb.ConvertVector(facingDir).normalized;

            /* Create the direction vectors */
            Vector3[] dirs = new Vector3[3];
            dirs[0] = facingDir;

            float orientation = SteeringBasics.VectorToOrientation(facingDir, rb.is3D);

            dirs[1] = SteeringBasics.OrientationToVector(orientation + sideWhiskerAngle * Mathf.Deg2Rad, rb.is3D);
            dirs[2] = SteeringBasics.OrientationToVector(orientation - sideWhiskerAngle * Mathf.Deg2Rad, rb.is3D);

            return(CastWhiskers(dirs, out firstHit));
        }