[ODE] visibility detemination?

skjold@cistron.nl skjold at cistron.nl
Mon Feb 17 11:27:01 2003


Hi Clint,


> Mark: "make an effort not to get physics code tangled up too much with 
> the rendering code"
> 
> I understand what you are saying, but I think all the 
> collision/intersection detection code would be nice to be able to share, 
> and since any collision engine will have those types of things 
> efficiently done the visibility system could just reuse those,  mainly 
> Axis Aligned Bounding Boxes, and a frustum class.

Of course, reuse is generally good, from the design/maintainability perspective. In fact, decent code reuse shows that different functionality is separated properly in your code, and is generic enough to serve various purposes.

ODE is itself a good example IMHO, you could use either the rigid bodies and joints or the geoms and collision detection completely separately, but they can work in perfect harmony as well.

The same thing should be possible with rendering code that works closely with the collision detection - or with the physics for that matter (imagine for example something like adding motion blur, or adapting LOD, in response to an object's velocity). And that's not even talking about sound effects yet...

... So that's the long version of my point, and I think it's totally compatible with your point. :)


> "Again, I'm just thinking out loud. Please feel free to stop me if it 
> gets annoying"
> not at all, thanks for the thoughts!

Happy to be able to help :)


> 
> "Maybe I'm missing something, but why would drawing primitives ever lay 
> outside collision primitives?"
> 
> Say I have a big creature, and that creature has a bunch of hair on it 
> that's just there to make it look good, but not to be collided with 
> because the hair squishes down.  The hair might not be inside the 
> collision geometry, but would still need to be rendered if it were 
> visible.  So the visibility bounding geometry would need to possibly be 
> different than the physics geometry.

Right, I hadn't thought of that. Thanks.

Greets,
Mark