Skip to content

setIsDebugItemDisplayed crash? #320

Answered by DanielChappuis
anugentc asked this question in Q&A
Discussion options

You must be logged in to vote

I think I know what you are doing wrong. The idea of the height-field is to provide only the height values of your grid and not the whole 3D coordinates of each point. Therefore, If you have a 4x4 height-field with a constant height of 1.0 then you must only put the 16 height values in your array. Your array would then be:

const float heights[] = {1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,}; };

This is the advantage of the HeightFieldShape compared to the ConcaveMeshShape, you only need to provide height values and the 3D mesh will be computed automatically by the library.

Replies: 8 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by DanielChappuis
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants