What is Wrong ?

Topics: Developer Forum
Apr 27, 2014 at 4:01 PM
1/ // 1/3 = 0.033333 … really ? I suppose that 1/30=0.033333

2/ and can anyone help me with this:
I have a circle placed at position X=0,Y=-5 meters, and ground placed at
X=0, Y=+5 meters. But ... it does not work...
FarseerPhysics::Dynamics::World^ _world = gcnew FarseerPhysics::Dynamics::World( Microsoft::Xna::Framework::Vector2( 0.0f, 9.81f ) ) ;

// supposing that left top corner has coordinates [0,0], left bottom corner [0,+Ymax]
            Microsoft::Xna::Framework::Vector2 circlePosition = Microsoft::Xna::Framework::Vector2( 0, -5 );

            FarseerPhysics::Dynamics::Body^ _circleBody = BodyFactory::CreateCircle( _world, 0.25f, 1.0f, circlePosition );
            _circleBody->BodyType = BodyType::Dynamic;
            Console::WriteLine( "circle body position {0} {1}", _circleBody->Position.X, _circleBody->Position.Y );

   // Give it some bounce and friction
   _circleBody->Restitution = 0.3f;
   _circleBody->Friction = 0.5f;
            
   /* Ground */
            Microsoft::Xna::Framework::Vector2 groundPosition = Microsoft::Xna::Framework::Vector2( 0, 5 ); 

   // Create the ground fixture
            FarseerPhysics::Dynamics::Body^ _groundBody = 
                BodyFactory::CreateRectangle( _world, 5000, 0.2f, 1.0f, groundPosition );

   _groundBody->IsStatic = true;
   _groundBody->Restitution = 0.3f;
   _groundBody->Friction = 0.5f;
            
            for ( Int32 i = 0; i < 25000; i++ ) {

                            _world->Step( 1.0f ); 

                            Console::WriteLine(" {0} {1}", _circleBody->Position.X, _circleBody->Position.Y );    

            }// for i