Beispiel #1
0
    public Vector2 GetGridPosition(float row, float col, int parity)
    {
        float       vShift         = PolyPieceGenerator.CalculateVStackDistance(6, mainRadius);
        const float OVERLAP_DIST   = 0.0f;
        float       lattice_offset = mainRadius - 0.5f;

        float x_translate    = (col * 2) * (mainRadius - OVERLAP_DIST);
        float odd_row_offset = parity * mainRadius;

        return(new Vector3(offsetUnits.x, offsetUnits.y) +
               new Vector3(lattice_offset + x_translate - odd_row_offset,
                           (0.5f + row) * vShift, transform.position.z));
    }
Beispiel #2
0
    public Vector2 GetVerticalVelocityByTimePeriod(float period)
    {
        float actualRadius = PolyPieceGenerator.CalculateVStackDistance(6, mainRadius);

        return(new Vector2(0.0f, actualRadius / period));
    }