1.4 transform and linear velocity bug
3 posters
1.4 transform and linear velocity bug
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:
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
Re: 1.4 transform and linear velocity bug
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
Re: 1.4 transform and linear velocity bug
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...
Re: 1.4 transform and linear velocity bug
Downgraded and its still doing it, looks like its not a bullet problem.
Don Jaffa- Posts : 49
Join date : 2009-02-19
Re: 1.4 transform and linear velocity bug
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
Re: 1.4 transform and linear velocity bug
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
Sorry...
Sorry...
Re: 1.4 transform and linear velocity bug
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
Re: 1.4 transform and linear velocity bug
Its in the blender file... select the zombie, then check the user property that have been set...
Re: 1.4 transform and linear velocity bug
Ahh, seems to have fixed it, thanks
For anyone else who has this problem, I fixed it by giving my vehicle a custom property of 'ma, 1.0' in blender.
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
Re: 1.4 transform and linear velocity bug
Ok correction it hasn't fixed it
Don Jaffa- Posts : 49
Join date : 2009-02-19
Re: 1.4 transform and linear velocity bug
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
Re: 1.4 transform and linear velocity bug
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,
Lemme know if you need consultation services on that...
Cheers,
Re: 1.4 transform and linear velocity bug
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
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
Re: 1.4 transform and linear velocity bug
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
only set the standard c++ lib to be dynamic and compile with the following compiler flags:
-fno-regmove -Wno-write-strings
Re: 1.4 transform and linear velocity bug
Ok thanks, i'll do that then
Don Jaffa- Posts : 49
Join date : 2009-02-19
Similar topics
» Simple Transform Animation System
» Regarding the Physics LinearVelocity
» _SIO2parent transform?
» texture transform
» How to get Transform from Physic Object?
» Regarding the Physics LinearVelocity
» _SIO2parent transform?
» texture transform
» How to get Transform from Physic Object?
Permissions in this forum:
You cannot reply to topics in this forum