Difference between revisions of "R3d.HeightFieldShape"
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
<!-- GIDEROSOBJ:r3d.HeightFieldShape --> | <!-- GIDEROSOBJ:r3d.HeightFieldShape --> | ||
| − | ''' | + | '''Supported platforms:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]][[File:Platform html5.png]][[File:Platform winrt.png]][[File:Platform win32.png]]<br/> |
| − | ''' | + | '''Available since:''' Gideros 2019.10<br/> |
=== Description === | === Description === | ||
| − | The HeightFieldShape is a collision shape that can be used to represent a static terrain for instance. | + | 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]''' |
| − | and column indexColumn is located at the following position in the array: | + | |
| − | + | 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. | |
| − | |||
{|- | {|- | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
| − | === | + | === Methods === |
| − | [[ | + | [[r3d.HeightFieldShape.new]] ''creates a new collision height field shape''<br/><!--GIDEROSMTD:r3d.HeightFieldShape.new(width,height,minAltitude,maxAltitude,field) creates a new collision height field shape--> |
| − | <!-- GIDEROSMTD:r3d.HeightFieldShape.new(width,height,minAltitude,maxAltitude,field) creates a new collision height field shape --> | + | |
| + | [[r3d.HeightFieldShape:setScale]] ''scales the collision height field shape''<br/><!--GIDEROSMTD:r3d.HeightFieldShape:setScale(number,number,number) scales the collision height field shape--> | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
Latest revision as of 06:23, 19 December 2025
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 |