Return the vertex (local-coordinates) of the height field at a given (x,y) position
| 397 | |
| 398 | // Return the vertex (local-coordinates) of the height field at a given (x,y) position |
| 399 | Vector3 HeightField::getVertexAt(uint32 x, uint32 y) const { |
| 400 | |
| 401 | // Get the height value |
| 402 | const decimal height = getHeightAt(x, y); |
| 403 | |
| 404 | const Vector3 vertex = Vector3(-mWidth * decimal(0.5) + x, mHeightOrigin + height, -mLength * decimal(0.5) + y); |
| 405 | |
| 406 | assert(mBounds.contains(vertex)); |
| 407 | |
| 408 | return vertex; |
| 409 | } |
| 410 | |
| 411 | // Return the string representation of the shape |
| 412 | std::string HeightField::to_string() const { |