Question about NewtonCreateHeightFieldCollision

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Question about NewtonCreateHeightFieldCollision

Postby aqnuep » Wed Nov 25, 2009 3:39 pm

Hi,

My question is about two parameters of NewtonCreateHeightFieldCollision:

* gridsDiagonals - what is this? if it is 1, then Newton will use triangles instead of quads?
* attributes - I can guess that with this we are able to set some attributes of the individual quads of the height field like material or something like this

Unfortunately I've seen only one usage of this function in the height field demo and these are all 0s so I am unable to figure out it's use.

Btw in the height field demo contains a minor code error:
Code: Select all
attibutes = (char*) malloc (width * width * sizeof (char));

Shouldn't be this like the following?
Code: Select all
attibutes = (char*) malloc (width * height * sizeof (char));


I've already uploaded some stuff about height field collisions to the Wiki, like putting it to the list of collision types and filling the function API entry of NewtonCreateHeightFieldCollision, but I would need the meaning of these parameters as well.

P.S.: Are height field collisions movable? If not it would be nice to have a bias factor as well.
aqnuep
 
Posts: 97
Joined: Sat Dec 22, 2007 4:14 pm

Re: Question about NewtonCreateHeightFieldCollision

Postby Julio Jerez » Wed Nov 25, 2009 3:49 pm

In a terrian a grid is made of two triangle, you can make the by conection lower left to upper right,
or by conecting upper left to lower right corner.
gridsDiagonals detrmin hwo dignal in each grid will be set.

In newton each shape can have a spale ID, collision tree you set teh ID when you add teh faces, shape take the ID when you create them,
Terrain take thier IDs from the AttributeMap.

aqnuep wrote:Are height field collisions movable? If not it would be nice to have a bias factor as well.

Ther are static bodies, but you can move them by setting the matrix,
what do you mean a bias factor?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Question about NewtonCreateHeightFieldCollision

Postby aqnuep » Wed Nov 25, 2009 3:51 pm

Thanks for the fast reply, I'll update then the Wiki.

Sorry, I've edited the post since the first submit, so I repeat the question in case you haven't seen yet:

Are height field collisions movable? If not it would be nice to have a bias factor as well.
aqnuep
 
Posts: 97
Joined: Sat Dec 22, 2007 4:14 pm

Re: Question about NewtonCreateHeightFieldCollision

Postby Julio Jerez » Wed Nov 25, 2009 3:55 pm

aqnuep wrote: Are height field collisions movable? If not it would be nice to have a bias factor as well.

They are static bodies, but you can move them by setting the matrix of the body,
what do you mean a bias factor?Julio Jerez
Moderator
Posts: 2266
Joined: 14 Sep 2003 10:18 am
Location: Los Angeles
Private messageE-mail Julio JerezWebsite
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Question about NewtonCreateHeightFieldCollision

Postby aqnuep » Wed Nov 25, 2009 3:59 pm

I mean of bias factor an initial position for the height field, however it is totally unnecessary if I can set the matrix of the body in the same fashion as in case of other bodies.

Thanks and sorry for the double post!
aqnuep
 
Posts: 97
Joined: Sat Dec 22, 2007 4:14 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron