コード例 #1
0
ファイル: Way.cs プロジェクト: Cdrix/SM
    /// <summary>
    /// Will return the list of subpoint from start to end ...
    /// by default will use substep from MeshManager
    /// </summary>
    /// <param name="subStepX">substep in X, if is not provided will use substep from MeshManager</param>
    /// <param name="subStepZ">substep in Z, if is not provided will use substep from MeshManager</param>
    /// <returns></returns>
    List <Vector3> RetOneDirectionList(Vector3 start, Vector3 end, float subStepX, float subStepZ)
    {
        float epsilon = 0.001f;
        //find the common axis.
        H axis = RetCommonAxis(start, end, epsilon);

        //then we invert the axis bz that the one I will work on. The one is not common
        axis = invertAxis(axis);

        float min     = UMath.ReturnMinFromVector3(start, end, axis);
        float max     = UMath.ReturnMaxFromVector3(start, end, axis);
        float subStep = Mathf.Abs(RetSubStep(axis, subStepX, subStepZ));

        //this is set only for X and Z
        List <Vector3> res = new List <Vector3>();

        res = ReturnFromMinToMax(axis, subStep, min, max, start);
        return(res);
    }