<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/7664" />

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2011-12-05T16:21:14+00:00</updated>

	<author><name><![CDATA[Real-Time Physics Simulation Forum]]></name></author>
	<id>https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/7664</id>

		<entry>
		<author><name><![CDATA[Dr.Shepherd]]></name></author>
		<updated>2011-12-05T16:21:14+00:00</updated>

		<published>2011-12-05T16:21:14+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=26369#p26369</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=26369#p26369"/>
		<title type="html"><![CDATA[Re: Can't Move rigid body / Apply force]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=26369#p26369"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>btDynamicsWorld::stepSimulation( btScalar timeStep,   int maxSubSteps=1,   btScalar fixedTimeStep=btScalar(1.)/btScalar(60.));</code></pre></div>If you pass a very large timeStep as the first parameter [say, five times the size of the fixed internal time step], then you must increase the number of maxSubSteps to compensate for this, otherwise your simulation is “losing” time.<br><br>In your code, the first variable is "elapsed", it should be the root of the problem. You maybe made a mistake in the unit. (seconds/milliseconds)<br><br>check out this tutorial article:<br><a href="http://bulletphysics.org/mediawiki-1.5.8/index.php/Stepping_the_World" class="postlink">http://bulletphysics.org/mediawiki-1.5. ... _the_World</a><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=7605">Dr.Shepherd</a> — Mon Dec 05, 2011 4:21 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alundra]]></name></author>
		<updated>2011-12-05T14:10:17+00:00</updated>

		<published>2011-12-05T14:10:17+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=26368#p26368</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=26368#p26368"/>
		<title type="html"><![CDATA[Re: Can't Move rigid body / Apply force]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=26368#p26368"><![CDATA[
Here the bullet code I use to create a world, static plane and a ball :<br><div class="codebox"><p>Code: </p><pre><code>broadphase = new btDbvtBroadphase();collisionConfiguration = new btDefaultCollisionConfiguration();dispatcher = new btCollisionDispatcher(collisionConfiguration);solver = new btSequentialImpulseConstraintSolver;dynamicsWorld = new btDiscreteDynamicsWorld(dispatcher,broadphase,solver,collisionConfiguration);dynamicsWorld-&gt;setGravity(btVector3(0.0f,-9.81f,0.0f));plane_shape = new btStaticPlaneShape( btVector3( 0.0f, 1.0f, 0.0f ), 0.0f );plane_body = new btRigidBody( 0.0, new btDefaultMotionState, plane_shape, btVector3( 0.0f, 0.0f, 0.0f ) );dynamicsWorld-&gt;addRigidBody( plane_body );ball_shape = new btSphereShape(1.0);ball_body = new btRigidBody( 10.0f, new btDefaultMotionState, ball_shape, btVector3( 5.0f, 5.0f, 5.0f ) );ball_body-&gt;translate( btVector3( 0.0f, 10.0f, 0.0f ) );dynamicsWorld-&gt;addRigidBody( ball_body );</code></pre></div>Here the code I use to Update the simulation and translate the sphere :<br><div class="codebox"><p>Code: </p><pre><code>if( IsKeyDown( Key::F ) )  ball_body-&gt;translate( btVector3( 0.0f, 5.0f, 0.0f ) );dynamicsWorld-&gt;stepSimulation( Elapsed, 10 );</code></pre></div>Problem : The ball translate "Y += 5.0f", but don't update its position with gravity, it stay static.<br>Goal : I would manage all movement by bullet : translation, rotation, force ... Is it possible ?<br><br>Thanks for the help<br><br>EDIT :<br><br>The ball update with gravity using :<div class="codebox"><p>Code: </p><pre><code>dynamicsWorld-&gt;stepSimulation( 1.0f / 60.0f, 10 );</code></pre></div>But I've got some case when the ball stay static and never update its position again with gravity.<br>Is it normal I must use 1/60 to get it to work ?<br><br>Using this code the ball doesn't move :<div class="codebox"><p>Code: </p><pre><code>ball_body-&gt;applyForce( btVector3( 10.0f, 0.0f, 0.0f ), btVector3( 0.0f, 0.0f, 0.0f ) );</code></pre></div>Maybe i don't set correctly the force ?<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=8628">Alundra</a> — Mon Dec 05, 2011 2:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dr.Shepherd]]></name></author>
		<updated>2011-12-03T16:13:41+00:00</updated>

		<published>2011-12-03T16:13:41+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=26351#p26351</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=26351#p26351"/>
		<title type="html"><![CDATA[Re: Can't Move rigid body / Apply force]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=26351#p26351"><![CDATA[
<blockquote class="uncited"><div>Hi,<br>I have bullet correctly initialized and have 200 sphere who collide, all works fine but when i want apply force to a rigid body he doesn't do anything or if i use translate( vec3 ) on a simple sphere on a plane, he moves but don't update his position with gravity.<br><br>Do I have forget something ?<br>Thanks for help</div></blockquote>Too little information, either you paste your code here, or describe your problem more clearly.<br><br>There may be problem with your initialization of rigid bodies, or the force is not applied correctly.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=7605">Dr.Shepherd</a> — Sat Dec 03, 2011 4:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alundra]]></name></author>
		<updated>2011-12-02T01:02:11+00:00</updated>

		<published>2011-12-02T01:02:11+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=26332#p26332</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=26332#p26332"/>
		<title type="html"><![CDATA[Can't Move rigid body / Apply force]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=26332#p26332"><![CDATA[
Hi,<br>I have bullet correctly initialized and have 200 sphere who collide, all works fine but when i want apply force to a rigid body he doesn't do anything or if i use translate( vec3 ) on a simple sphere on a plane, he moves but don't update his position with gravity.<br><br>Do I have forget something ?<br>Thanks for help<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=8628">Alundra</a> — Fri Dec 02, 2011 1:02 am</p><hr />
]]></content>
	</entry>
	</feed>
