[ODE] Heightfield position.

gl gl at ntlworld.com
Mon Feb 24 16:39:02 2003


Thanks for the replies.  So, is everybody cool with having the heightfield
geom position in the field's center?  Note that the 'center' I'm talking
about is the 2D center, and the center of a field's largest possible +-
height value.  Think of the field has having height extents of -0.5f - +0.5f
(scaled to your desired height range), with the center being at 0.

Not only would this match other geoms closely, but it would also allow for
dynamic tile scaling without affecting the position (well, someone might
find a use for it : ).

Another thing - basically I create a tile's AABB from the user-supplied
min/max heights, as you would expect (these can be modified at run-time for
dynamic fields).  It ocurred to me though that I should probably extend the
floor of this AABB by some value.  Imagine the case where a terrain tile is
completely flat - the AABB would then also be completely flat, which would
no doubt result in collisisions being missed (especially against bodies
moving at some speed) ... I can hack my own to suit me, but any idea what
this value should be to catch all potential uses?
--
gl

----- Original Message -----
From: "Chris Brodie" <Chris.Brodie@macquarie.com>
To: <ode@q12.org>
Sent: Monday, February 24, 2003 10:40 PM
Subject: RE: [ODE] Heightfield position.


> > -----Original Message-----
> > From: gl [mailto:gl@ntlworld.com]
> >
> > How do you guys specify your heightfield positions?  I currently use a
> > tile's center (which I guess is more in line with other geoms), so I'm
> > wondering if that's common or not.
>
> My method is is based on a 'top left corner'. Thsi method was just grown
out of programming convenience. All heightfield offsets then of course are
easy to just 'add' to the top left corner in a right and down direction(when
thinking of a heightfield in 2D.
>
> For the AABB I keep the highest and lowest heightfield values and after
all tiles are generated I get the bottom right point. I feed these 2 3D
points in to the CAABB class, it has a simple .GetCentre() type member that
returns the centre of the box, which I use for the geom.
>
> I only mentioning all this to demonstrate how other methods can evolve.
That said, I can easily adapt my code to a new method.
>
>
> NOTICE
> This e-mail and any attachments are confidential and may contain copyright
material of Macquarie Bank or third parties. If you are not the intended
recipient of this email you should not read, print, re-transmit, store or
act in reliance on this e-mail or any attachments, and should destroy all
copies of them. Macquarie Bank does not guarantee the integrity of any
emails or any attached files. The views or opinions expressed are the
author's own and may not reflect the views or opinions of Macquarie Bank.
>
> _______________________________________________
> ODE mailing list
> ODE@q12.org
> http://q12.org/mailman/listinfo/ode
>