1.4 transform and linear velocity bug

View previous topic View next topic Go down

1.4 transform and linear velocity bug

Post  Don Jaffa on Wed Jul 29, 2009 12:45 pm

In my game the main player character is a little vehicle, which when steering input is made it rotates slightly to the left and right (using player_>_SIO2transform->rot->y) while at the same time the forward movement and lateral 'strafing' movement are provided by "player->_SIO2objectphysic->_btRigidBody->setLinearVelocity( btVector3( MOV_DIR * SPEED, CAR_SPEED, 0 ) );".

This works fine in 1.3.5, however in 1.4 the car moves forward fine until it needs to rotate, at which point the 'setLinearVelocity' stops working and the car stops moving. Anyone have any ideas why this might be happening?

Code sample:
Code:
player->_SIO2transform->rot->x = 0; //added in 1.4 as for some reason without it the car is animated at 45*
player->_SIO2transform->rot->y = (ROTZ * 10);
player->_SIO2transform->rot->z = (ROTZ * -10);
   
sio2TransformBindMatrix( player->_SIO2transform );
btMatrix3x3 mat3;
mat3.setFromOpenGLSubMatrix( (btScalar *)player->_SIO2transform->mat );
player->_SIO2objectphysic->_btRigidBody->getWorldTransform().setBasis( mat3 );

player->_SIO2objectphysic->_btRigidBody->setActivationState( ACTIVE_TAG );
player->_SIO2objectphysic->_btRigidBody->setLinearVelocity( btVector3( MOV_DIR * SPEED, CAR_SPEED, 0 ) );

Don Jaffa

Posts : 49
Join date : 2009-02-19

View user profile

Back to top Go down

Re: 1.4 transform and linear velocity bug

Post  Don Jaffa on Wed Jul 29, 2009 12:59 pm

Its also worth noting that when I changed the input to touch screen rather than accelerometer and didn't input anything for a few seconds after the game started this doesn't happen - however if I change the linear velocity to not read any values for the first few seconds, or change the accel input so it doesn't read the accelerometer values for the first few seconds it still stops the car moving as soon as the linearvelocity line can receive an input, making me very confused :S

Don Jaffa

Posts : 49
Join date : 2009-02-19

View user profile

Back to top Go down

Re: 1.4 transform and linear velocity bug

Post  sio2interactive on Wed Jul 29, 2009 1:51 pm

Try to downgrade back to the previous version of Bullet used by 1.3.5... just to check if it comes from bullet or not...

_________________
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 : 37
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

Re: 1.4 transform and linear velocity bug

Post  Don Jaffa on Wed Jul 29, 2009 2:20 pm

Downgraded and its still doing it, looks like its not a bullet problem.

Don Jaffa

Posts : 49
Join date : 2009-02-19

View user profile

Back to top Go down

Re: 1.4 transform and linear velocity bug

Post  monkeys on Wed Jul 29, 2009 9:08 pm

I believe this is related to the same problem I have been having trying to get the 'zombie' character from the new tutorial 15 to move using 'setlinearvelocity'. It will rotate no problems at all, but trying to apply linear velocity does nothing...

monkeys

Posts : 8
Join date : 2009-07-22

View user profile

Back to top Go down

Re: 1.4 transform and linear velocity bug

Post  sio2interactive on Wed Jul 29, 2009 9:48 pm

Ok I check it out... for tutorial15, I demonstrate how to override/set properties manually... but instead of typing mr for margin I type ma for mass and set it to 0.0 that's why the linear velocity is not working with the zombie Wink

Sorry...

_________________
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 : 37
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

Re: 1.4 transform and linear velocity bug

Post  Don Jaffa on Thu Jul 30, 2009 10:53 am

Where in tutorial 15 is this? I have searched the whole tutorial several times and can't find it.

Don Jaffa

Posts : 49
Join date : 2009-02-19

View user profile

Back to top Go down

Re: 1.4 transform and linear velocity bug

Post  sio2interactive on Thu Jul 30, 2009 2:03 pm

Its in the blender file... select the zombie, then check the user property that have been set...

_________________
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 : 37
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

Re: 1.4 transform and linear velocity bug

Post  Don Jaffa on Thu Jul 30, 2009 2:32 pm

Ahh, seems to have fixed it, thanks Very Happy

For anyone else who has this problem, I fixed it by giving my vehicle a custom property of 'ma, 1.0' in blender.

Don Jaffa

Posts : 49
Join date : 2009-02-19

View user profile

Back to top Go down

Re: 1.4 transform and linear velocity bug

Post  Don Jaffa on Thu Jul 30, 2009 3:18 pm

Ok correction it hasn't fixed it scratch

Don Jaffa

Posts : 49
Join date : 2009-02-19

View user profile

Back to top Go down

Re: 1.4 transform and linear velocity bug

Post  sio2interactive on Thu Jul 30, 2009 4:38 pm

Just set the mass in the physic panel...

_________________
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 : 37
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

Re: 1.4 transform and linear velocity bug

Post  Don Jaffa on Thu Jul 30, 2009 5:03 pm

Well, either way, the mass doesn't appear to be the issue, linear velocity is still refusing to work on the car as soon as lateral input is made, at least for the first few seconds of the process running (I also disabled object rotation and it still did it, leading me to believe this has nothing to do with it).

Don Jaffa

Posts : 49
Join date : 2009-02-19

View user profile

Back to top Go down

Re: 1.4 transform and linear velocity bug

Post  sio2interactive on Thu Jul 30, 2009 5:41 pm

Dude I really don't know what you can possibly do wrong... cuz its like 100% sure that it work...

Lemme know if you need consultation services on that...

Cheers,

_________________
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 : 37
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

Re: 1.4 transform and linear velocity bug

Post  Don Jaffa on Thu Jul 30, 2009 6:43 pm

Would it be possible to get a version of 1.3.5 with only the os 3.0 compatibility changes? As my game was running fine and maybe a day or 2 away from being submitted to apple, but now, its looking a *lot* less hopeful i'll be able to get this out any time soon.

And if not, would it be possible for you to say where exactly thee changes to be compatible with os 3.0 were made? so I can make the neccessary adjustments myself.

ty

Don Jaffa

Posts : 49
Join date : 2009-02-19

View user profile

Back to top Go down

Re: 1.4 transform and linear velocity bug

Post  sio2interactive on Thu Jul 30, 2009 6:47 pm

1.3.5 is compatible with 3.0...

only set the standard c++ lib to be dynamic and compile with the following compiler flags:

-fno-regmove -Wno-write-strings

_________________
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 : 37
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

Re: 1.4 transform and linear velocity bug

Post  Don Jaffa on Thu Jul 30, 2009 7:03 pm

Ok thanks, i'll do that then Razz

Don Jaffa

Posts : 49
Join date : 2009-02-19

View user profile

Back to top Go down

Re: 1.4 transform and linear velocity bug

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