Changes between Initial Version and Version 1 of Ticket #4825, comment 3


Ignore:
Timestamp:
May 1, 2020, 5:53:43 PM (4 years ago)
Author:
FeXoR

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #4825, comment 3

    initial v1  
    11Oh, but the function's names should be telling:
    2 ```getHeight(vector2D)``` should return the height of the vertex with the given integer coordinates and raise for float arguments.
     2```getHeight(x, y)``` should return the height of the vertex with the given integer coordinates and raise for float arguments.
    33```getExactHeight(vector2D)``` should return the calculated height at the floating coordinate.
    44```getTileHeight(x, y)``` should return the height of the center of the tile with the given indices.
     
    66While ```getTileHeight(x, y)``` could just return ```getExactHeight(vector2D(x + 0.5, y + 0.5))``` IMO it's more relevant to be fast then precise and should rather return
    77{{{
    8 getHeight(vector2D(x, y))
    9 + getHeight(vector2D(x + 1, y))
    10 + getHeight(vector2D(x+1, y+1))
    11 + getHeight(vector2D(x, y+1))
     8getHeight(x, y)
     9+ getHeight(x + 1, y)
     10+ getHeight(x+1, y+1)
     11+ getHeight(x, y+1)
    1212/ 4
    1313}}}