R3d.HeightFieldShape
Supported platforms: ![]()
![]()
![]()
![]()
![]()
![]()
![]()
Available since: Gideros 2019.10
Description
The HeightFieldShape is a collision shape that can be used to represent a static terrain for instance. This shape is a two dimensional grid that has a given height value at each point of the grid.
In order to create a HeightFieldShape, first we need to create an HeightField. To do that, we need to have an array with all the height values of our field. We can have height values of type integer, float or double. We need to specify the number of rows and columns of our two dimensional grid.
The height values in our array must be organized such that the value at row indexRow and column indexColumn is located at the following position in the array: heightValues[indexRow * nbColumns + indexColumn]
When creating a HeightFieldShape, the origin of the shape will be at the center of its bounding volume. Therefore, if you create a HeightFieldShape with a minimum height of 100 and a maximum height of 500, the maximum coordinates of the shape on the Y axis will be 200 and the minimum coordinates will be -200.
Methodsr3d.HeightFieldShape.new creates a new collision height field shape r3d.HeightFieldShape:setScale scales the collision height field shape |