An array of numbers, or height values, that are spread out along the x axis.
World spacing between the data points in X direction.
Max value of the data points in the data array. Will be computed automatically if not given.
Minimum value of the data points in the data array. Will be computed automatically if not given.
The body to which the shape is added to.
The local bounding sphere radius of this shape.
Whether to produce contact forces when in contact with other bodies. Note that contacts will be generated, but they will be disabled.
An array of numbers, or height values, that are spread out along the x axis.
World spacing between the data points in X and Y direction.
Identifier of the Shape.
Optional material of the shape that regulates contact properties.
Max value of the data points in the data array.
Minimum value of the data points in the data array.
The type of this shape. Must be set to an int > 0 by subclasses.
All the Shape types.
Get an AABB of a square in the heightfield
Get a triangle in the terrain in the form of a triangular convex shape.
Get the height in the heightfield at a given position
Get the index of a local position on the heightfield. The indexes indicate the rectangles, so if your terrain is made of N x N height data points, you will have rectangle indexes ranging from 0 to N-1.
Two-element array
If the position should be clamped to the heightfield edge.
Get max/min in a rectangle in the matrix data
An array to store the results in.
The result array, if it was passed in. Minimum will be at position 0 and max at 1.
Set the height value at an index. Don't forget to update maxValue and minValue after you're done.
Sets the height values from an image. Currently only supported in browser.
Call whenever you change the data array.
Computes the bounding sphere radius.
The result is stored in the property .boundingSphereRadius
Update the maxValue
property
Update the minValue
property
Get the volume of this shape
Heightfield shape class. Height data is given as an array. These data points are spread out evenly with a given distance.
Should be possible to use along all axes, not just y
should be possible to scale along all axes
Refactor elementSize to elementSizeX and elementSizeY