Passing Through Static Object (Beating my iPod seems to help)
2 posters
Passing Through Static Object (Beating my iPod seems to help)
I am trying to setup of a game that controls a rolling ball by tilting. I am programmatically achieving this by simply using the accelerometer values (times 10) as gravity's vector .
When I first got the physics working its seemed to work periodically. 5 out of 10 times the ball would fall through the floor (a static object) and the rest it would hit and roll around correctly. After some experimentation I found that if I gave my iPod a hardy smack the ball wouldn't penetrate (or at least was much less likely to).
I then decided that my scale was much to large. The floor was 7 units away (I believe in bullet this would be meters), and I would like to see the effect of quickly moving the ipod down (creating zero gs) so I need the world to be closer to centimeters in size. Now the ball always penetrates the floor, NO matter how hard I smack my ipod (I think the smacking thing needs to be resolved before giving this to other gamers).
I've removed the dynamic gravity controls, but that didn't fix it. I noticed that when starting the physics engine Mr. SIO2 lowers the fps to 15, I wonder if due to how close the ball is to the floor the engine doesn't have time to calculate the collision. However, changing this number doesn't solve the problem either.
Does anyone have any ideas?
Many thanks,
Jesse
When I first got the physics working its seemed to work periodically. 5 out of 10 times the ball would fall through the floor (a static object) and the rest it would hit and roll around correctly. After some experimentation I found that if I gave my iPod a hardy smack the ball wouldn't penetrate (or at least was much less likely to).
I then decided that my scale was much to large. The floor was 7 units away (I believe in bullet this would be meters), and I would like to see the effect of quickly moving the ipod down (creating zero gs) so I need the world to be closer to centimeters in size. Now the ball always penetrates the floor, NO matter how hard I smack my ipod (I think the smacking thing needs to be resolved before giving this to other gamers).
I've removed the dynamic gravity controls, but that didn't fix it. I noticed that when starting the physics engine Mr. SIO2 lowers the fps to 15, I wonder if due to how close the ball is to the floor the engine doesn't have time to calculate the collision. However, changing this number doesn't solve the problem either.
Does anyone have any ideas?
Many thanks,
Jesse
freakTheMighty- Posts : 12
Join date : 2009-03-05
Re: Passing Through Static Object (Beating my iPod seems to help)
Do multiple FULL pass like that (the FULL pass have been added in 1.3.5):
sio2PhysicRender( sio2->_SIO2physic,
sio2->_SIO2window->d_time, 2 );
which basically does this:
sio2PhysicRender( sio2->_SIO2physic,
sio2->_SIO2window->d_time, 2 );
which basically does this:
- Code:
void sio2PhysicRender( SIO2physic *_SIO2physic,
float _timestep,
int _pass )
{
unsigned int i = 0;
if( _SIO2physic->state == SIO2_PHYSIC_PLAY )
{
float sub = _timestep / ( float )_pass;
while( i != _pass )
{
_SIO2physic->_btSoftRigidDynamicsWorld->stepSimulation( sub, 0 );
++i;
}
}
}
EXC_BAD_ACCESS
I updated to 1.3.5 and my program is breaking out with an EXC_BAD_ACCESS error. I've run across this before when I tried to load an object into sio2->_SIO2object, to then add to my physics world. I fixed it by loading it into a local SIO2object instead. This no longer works. And if I don't add it to the physic world my screen draws black . . . (though I don't see you adding your cubes in tutorial 6_1 to a physic world).
I can see there is some structural thing I'm not understanding with SIO2 so debugging for a bad_access error is quite difficult. Any pointers?
I can see there is some structural thing I'm not understanding with SIO2 so debugging for a bad_access error is quite difficult. Any pointers?
freakTheMighty- Posts : 12
Join date : 2009-03-05
same problem
I'm still getting the same error when trying to add a physic object to the world or alternatively a black screen when I avoid the kind of calls that cause the error.
freakTheMighty- Posts : 12
Join date : 2009-03-05
Re: Passing Through Static Object (Beating my iPod seems to help)
What type of collision bounds? If its either static triangle mesh or convexhull, you need to call sio2MapBuffer before adding the object to the physic world instead there's no vertices to pass to blender.
If its not one of theses make sure that you have a valid pointer for _SIO2physic & _SIO2object
If its not one of theses make sure that you have a valid pointer for _SIO2physic & _SIO2object
Similar topics
» Object passing through terrain???
» Reposition a static physics object
» Static Camera to follow an Object
» SIO2 prebuilt & updated static Library on svn
» Static Objects
» Reposition a static physics object
» Static Camera to follow an Object
» SIO2 prebuilt & updated static Library on svn
» Static Objects
Permissions in this forum:
You cannot reply to topics in this forum