Gravity in SIO2?

View previous topic View next topic Go down

Gravity in SIO2?

Post  CadetCrusher on Wed Oct 07, 2009 1:49 pm

I'm a super noob to SIO2 so this may be in the wrong section, but here's my question: Can you set the value of gravity in Blender/SIO2? More specifically, I'm making a game with a ship that you fly around in outer space. But as I'm finding out you can't use the setLinearVelocity() on a static object. The problem is when I set the player object (the ship) to be a dynamic object it starts falling towards the "ground". Is there a way to set gravity to 0? What would you suggest?

Thanks!

CadetCrusher

Posts : 21
Join date : 2009-10-07

View user profile

Back to top Go down

Re: Gravity in SIO2?

Post  sio2interactive on Wed Oct 07, 2009 1:59 pm

Yes, but you'll have to do it in code... check tutorial061 for an example of how to set the gravity...

_________________
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: Gravity in SIO2?

Post  Francescu on Wed Oct 07, 2009 1:59 pm

Check tutorial06 source code for example...

EAGLview.mm

Code:

      // Set the gravity of the physic world, to
      // something similar as earth. Please take note
      // that the default up vector of SIO2 is the positive
      // Z axis. So gravity should go down on the negative
      // Z axis.
      sio2PhysicSetGravity( sio2->_SIO2physic, &gravity );   

Francescu

Posts : 136
Join date : 2009-03-18

View user profile

Back to top Go down

Re: Gravity in SIO2?

Post  CadetCrusher on Wed Oct 07, 2009 2:03 pm

Cool! Thanks! That was fast.

CadetCrusher

Posts : 21
Join date : 2009-10-07

View user profile

Back to top Go down

Re: Gravity in SIO2?

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