MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / getVertexAt

Method getVertexAt

src/collision/HeightField.cpp:399–409  ·  view source on GitHub ↗

Return the vertex (local-coordinates) of the height field at a given (x,y) position

Source from the content-addressed store, hash-verified

397
398// Return the vertex (local-coordinates) of the height field at a given (x,y) position
399Vector3 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
412std::string HeightField::to_string() const {

Callers 3

testHeightFieldMethod · 0.45
testHeightFieldScaledMethod · 0.45
drawHeightFieldShapeMethod · 0.45

Calls 2

Vector3Class · 0.50
containsMethod · 0.45

Tested by 2

testHeightFieldMethod · 0.36
testHeightFieldScaledMethod · 0.36