예제 #1
0
    // 水面是否存在实现
    public bool GetWaterExists(float x, float z)
    {
        x -= CFunction.GetTerrainLeft();
        z -= CFunction.GetTerrainTop();

        return(InnerGetWaterExists(x, z));
    }
예제 #2
0
    // 获得水面基本高度实现
    public float GetWaterBaseHeight(float x, float z)
    {
        x -= CFunction.GetTerrainLeft();
        z -= CFunction.GetTerrainTop();

        return(InnerGetWaterBaseHeight(x, z));
    }
예제 #3
0
    // 球体范围碰撞实现
    public bool TraceSphere(Vector3 _center, float radius)
    {
        Vector3 center = _center;

        center.x -= CFunction.GetTerrainLeft();
        center.z -= CFunction.GetTerrainTop();

        return(InnerTraceSphere(center, radius));
    }
예제 #4
0
    // 碰撞测试是否有阻挡实现
    public bool TraceHitted(Vector3 _src, Vector3 _dst)
    {
        Vector3 src = _src;
        Vector3 dst = _dst;

        src.x -= CFunction.GetTerrainLeft();
        src.z -= CFunction.GetTerrainTop();

        dst.x -= CFunction.GetTerrainLeft();
        dst.z -= CFunction.GetTerrainTop();

        return(InnerTraceHitted(src, dst));
    }
예제 #5
0
    public bool TraceDetail(Vector3 _src, Vector3 _dst, ref RaycastHit[] hits, ref int hit_count)
    {
        Vector3 src = _src;
        Vector3 dst = _dst;

        src.x -= CFunction.GetTerrainLeft();
        src.z -= CFunction.GetTerrainTop();

        dst.x -= CFunction.GetTerrainLeft();
        dst.z -= CFunction.GetTerrainTop();

        return(InnerTraceDetail(src, dst, ref hits, ref hit_count));
    }