[ODE] dHeightfield collider

Piotr Obrzut piotr_obrzut at o2.pl
Thu Mar 30 08:56:38 MST 2006


Hi,

27 marca 2006 (12:42:00) Geoff wrote:

> Hi,
> One case to consider is where the terrain data is stored in a non-float
> format in the application.  For example, some games use a compressed 
> representation with a uint16 or even uint8 per vertex (with a suitable
> offset and scale given per "region").  A general ODE heightfield would
> allow the app to use its own custom format, avoiding data duplication 
> inside the geom object.

> I would consider a general solution is a terrain geom where we can 
> define two query operations:
>     bool GetDepth(const dVector3& pos, float& resultDepth, dVector3& 
> resultNormal);
>     void GetHeightfieldUp(dVector3& resultNormal);

> The second callback is in case we need to get the basic "up" invariant
> of the heightfield (e.g. +Y, or +Z).  If no collision code needed this,
> then we could eliminate that function altogether, which would make the
> solution much cleaner, as well as more powerful.  That way a 
> parametrically defined heightfield could be any shape, such as a 
> spherical one.


I've checked this and the only difference (between y and z) here is
'GetHeight' and 'computeAABB()' the rest could be easily
changed (but it might be that I've overlooked something). Using
something on 'GetDepth' generality level will be realy useful.


-- 
greetings,
 Piotr Obrzut



More information about the ODE mailing list