Culling and Bullet

View previous topic View next topic Go down

Culling and Bullet

Post  Faikus on Fri Jun 05, 2009 4:32 am

Hi,

it seems to me resource culling is based on the object's sio2 coordinates saved in _SIO2object->_SIO2transform->loc. For physical objects, however, their "real" coordinates are computed by bullet and stored in _btRigidBody. Bullet's coordinates are transferred to sio2 coordinates in sio2ObjectRender, but this method is not called if the object has been culled. It seems this is a problem if Bullet moves the object back into the frustum: since the object is culled based on its (old) sio2 coordinates, it never gets the updated Bullet coordinates that would prevent it from being culled again. So objects that once were outside the frustum and are moved inside the frustum by Bullet are not shown.

Faikus

Posts : 23
Join date : 2009-05-26
Location : Berlin

View user profile

Back to top Go down

Re: Culling and Bullet

Post  sio2interactive on Fri Jun 05, 2009 6:18 pm

Like in tutorial06


sio2ResourceRender( sio2->_SIO2resource,
sio2->_SIO2window,
sio2->_SIO2camera,
SIO2_RENDER_SOLID_OBJECT | SIO2_RENDER_CLIPPED_OBJECT );


This will force the clipped object to update their physic matrix, but not render them if they are out of the frustum...

_________________
SIO2 Interactive
Free Open Source 3D Game Engine for iPhone and iPod Touch
http://sio2interactive.com
avatar
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 38
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

Re: Culling and Bullet

Post  Faikus on Sat Jun 06, 2009 5:44 am

Ok, that works. Is the flag SIO2_RENDER_CLIPPED_OBJECT supposed to be used in all scenarios with physics objects? Is there another reason for this flag? Why, for example, doesn't the engine just update sio2's coordinates for all physical objects from their bullet coordinates at the end of sio2PhysicRender?

Faikus

Posts : 23
Join date : 2009-05-26
Location : Berlin

View user profile

Back to top Go down

Re: Culling and Bullet

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum