<?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/10043" />

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2014-08-06T18:49:14+00:00</updated>

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

		<entry>
		<author><name><![CDATA[BlueSpud]]></name></author>
		<updated>2014-08-06T18:49:14+00:00</updated>

		<published>2014-08-06T18:49:14+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=33773#p33773</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=33773#p33773"/>
		<title type="html"><![CDATA[Objects Flying Off to -X]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=33773#p33773"><![CDATA[
Hey,<br>So I downloaded bullet today because I've heard nothing but good things about it. Unfortunately, after reading a quick tutorial, something went terribly wrong XD. So I created plane to serve as the ground and then added a sphere above it and let it fall onto the plane. It hits the ground like I'd expect and then just starts infinitely accelerating towards the negative x and keeping a constant z and y. Here is my code:<div class="codebox"><p>Code: </p><pre><code>physicsWorld::physicsWorld()    {        //create all the world components        bulletConfiguration = new btDefaultCollisionConfiguration();        bulletDispatcher = new btCollisionDispatcher(bulletConfiguration);        bulletBroadPhaseInterface = new btDbvtBroadphase();        bulletSolver = new btSequentialImpulseConstraintSolver();                //create the world        bulletWorld = new btDiscreteDynamicsWorld(bulletDispatcher,bulletBroadPhaseInterface,bulletSolver,bulletConfiguration);        bulletWorld-&gt;setGravity(btVector3(0,-10,0));                //here are some temp gemoetries        btTransform t;        t.setIdentity();        t.setOrigin(btVector3(0,0,0));                btStaticPlaneShape* plane = new btStaticPlaneShape(btVector3(0,1,0),0.0);        btMotionState* motionStatePlane = new btDefaultMotionState(t);        btRigidBody::btRigidBodyConstructionInfo info(0.0,motionStatePlane,plane);        btRigidBody* planeBody = new btRigidBody(info);                        rigidBodies.push_back(planeBody);        bulletWorld-&gt;addRigidBody(planeBody);                addRigidSpehere(1, glm::vec3(0,3,0));                    }physicsWorld::~physicsWorld()    {        //delete everything        delete bulletWorld;        delete bulletConfiguration;        delete bulletDispatcher;        delete bulletBroadPhaseInterface;        delete bulletSolver;                //delete all the rigid bodies        for (int i = 0; i &lt;  rigidBodies.size(); i ++)            {                delete rigidBodies[i];            }             }void physicsWorld::update(double time)    {        bulletWorld-&gt;stepSimulation(time);    }btRigidBody* physicsWorld::addRigidSpehere(float rad, glm::vec3 position)    {        btTransform t;        t.setIdentity();        t.setOrigin(btVector3(position.x,position.y,position.z));                btSphereShape* sphere = new btSphereShape(rad);                //calculate inertia        btVector3 inertia(0.0,0.0,0.0);        sphere-&gt;calculateLocalInertia(1.0, inertia);                btMotionState* motionState = new btDefaultMotionState(t);        btRigidBody::btRigidBodyConstructionInfo info(1.0,motionState,sphere,inertia);        btRigidBody* sphereBody = new btRigidBody(info);                rigidBodies.push_back(sphereBody);        bulletWorld-&gt;addRigidBody(sphereBody);                return sphereBody;    }</code></pre></div>and then in my main loop <div class="codebox"><p>Code: </p><pre><code> SceneRenderer.currentScene-&gt;PhysicsWorld-&gt;update(1.0/60.0);</code></pre></div>If anyone could help me, I would really appreciate it. Thanks.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=10949">BlueSpud</a> — Wed Aug 06, 2014 6:49 pm</p><hr />
]]></content>
	</entry>
	</feed>
