collision and scale :(

View previous topic View next topic Go down

collision and scale :(

Post  sakrist on Wed May 13, 2009 3:58 pm

Hello

I have problems

If i scaled object then collision is don't working. If scale of object = 1 then all is great!

tutorial 9

Why Question Question Question Question

Please, help Exclamation Exclamation Exclamation Exclamation Exclamation

Thanks!


Last edited by sakrist on Tue May 19, 2009 6:23 am; edited 1 time in total
avatar
sakrist

Posts : 23
Join date : 2009-04-28
Age : 29

View user profile http://www.developers-life.com

Back to top Go down

Re: collision and scale :(

Post  sio2interactive on Wed May 13, 2009 4:08 pm

Bullet doesn't support scaled matrices... and watch the video tutorial06_1 I talk about that in details...

_________________
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: collision and scale :(

Post  sw on Wed May 13, 2009 8:35 pm

you can remove the physic attribute and then add the physic attribute after you scale the object
avatar
sw

Posts : 73
Join date : 2008-10-12

View user profile

Back to top Go down

Re: collision and scale :(

Post  sakrist on Fri May 15, 2009 9:14 am

sw wrote:you can remove the physic attribute and then add the physic attribute after you scale the object

how to do it?

please

Code:

SIO2object *object = ( SIO2object * )sio2ResourceGet( sio2->_SIO2resource,
                                           SIO2_OBJECT,
                                           objectName );
   
   
   sio2PhysicRemoveObject( sio2->_SIO2physic, object );
   
   object->_SIO2transform->scl->x = 0.5;
   object->_SIO2transform->scl->y = 0.5;
   object->_SIO2transform->scl->z = 0.5;
   
   sio2PhysicAddObject( sio2->_SIO2physic, object );

this code don't work
avatar
sakrist

Posts : 23
Join date : 2009-04-28
Age : 29

View user profile http://www.developers-life.com

Back to top Go down

Re: collision and scale :(

Post  sw on Fri May 15, 2009 10:12 am

sio2PhysicRemoveObject( sio2->_SIO2physic, object );

object->_SIO2transform->scl->x = 0.5;
object->_SIO2transform->scl->y = 0.5;
object->_SIO2transform->scl->z = 0.5;

object->dim->x = object->dim->x * 0.5f;
object->dim->y = object->dim->y * 0.5f;
object->dim->z = object->dim->z * 0.5f;

sio2PhysicAddObject( sio2->_SIO2physic, object );
avatar
sw

Posts : 73
Join date : 2008-10-12

View user profile

Back to top Go down

Re: collision and scale :(

Post  sakrist on Fri May 15, 2009 2:22 pm

sw wrote:sio2PhysicRemoveObject( sio2->_SIO2physic, object );

object->_SIO2transform->scl->x = 0.5;
object->_SIO2transform->scl->y = 0.5;
object->_SIO2transform->scl->z = 0.5;

object->dim->x = object->dim->x * 0.5f;
object->dim->y = object->dim->y * 0.5f;
object->dim->z = object->dim->z * 0.5f;

sio2PhysicAddObject( sio2->_SIO2physic, object );

thanks

camera is work , but not collision pale

what me doing Question


Last edited by sakrist on Tue May 19, 2009 6:23 am; edited 1 time in total
avatar
sakrist

Posts : 23
Join date : 2009-04-28
Age : 29

View user profile http://www.developers-life.com

Back to top Go down

Re: collision and scale :(

Post  sakrist on Fri May 15, 2009 2:30 pm

sio2interactive wrote:Bullet doesn't support scaled matrices... and watch the video tutorial06_1 I talk about that in details...

Which of the video?


Last edited by sakrist on Tue May 19, 2009 6:23 am; edited 1 time in total
avatar
sakrist

Posts : 23
Join date : 2009-04-28
Age : 29

View user profile http://www.developers-life.com

Back to top Go down

Re: collision and scale :(

Post  sw on Fri May 15, 2009 9:06 pm

sakrist wrote:
sw wrote:sio2PhysicRemoveObject( sio2->_SIO2physic, object );

object->_SIO2transform->scl->x = 0.5;
object->_SIO2transform->scl->y = 0.5;
object->_SIO2transform->scl->z = 0.5;

object->dim->x = object->dim->x * 0.5f;
object->dim->y = object->dim->y * 0.5f;
object->dim->z = object->dim->z * 0.5f;

sio2PhysicAddObject( sio2->_SIO2physic, object );

thanks

camera is work , but not collision pale

what me doing Question
You need to adjust the origin of the collision object
avatar
sw

Posts : 73
Join date : 2008-10-12

View user profile

Back to top Go down

Re: collision and scale :(

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