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

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2017-06-03T16:30:13+00:00</updated>

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

		<entry>
		<author><name><![CDATA[i7.strelok]]></name></author>
		<updated>2017-06-03T16:30:13+00:00</updated>

		<published>2017-06-03T16:30:13+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=39423#p39423</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=39423#p39423"/>
		<title type="html"><![CDATA[How to move a kinematic body?]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=39423#p39423"><![CDATA[
I try to develop my FPS-Game, I need to move the player, but if I use dynamic-body, I change its rotation too, I think that I need to use the kinematic-body, but ... how to move the kinematic body ? Or How to disable the other axes?<br><div class="codebox"><p>Code: </p><pre><code>void PlayState::createPlayer(){   Vector3 size = Vector3::ZERO;// size of the box     Vector3 position = _nodePerson-&gt;_getDerivedPosition();  position.y +=2;  Ogre::Quaternion rotation = _nodePerson-&gt;_getDerivedOrientation();  // Obtenemos la bounding box de la entidad creada... ------------  AxisAlignedBox boundingB = _sceneMgr-&gt;getEntity("BoxPlayer")-&gt;getBoundingBox();  size = boundingB.getSize(); // size.y*=2;  size /= 2.0f;   // El tamano en Bullet se indica desde el centro   // after that create the Bullet shape with the calculated size  OgreBulletCollisions::BoxCollisionShape *boxShape = new     OgreBulletCollisions::BoxCollisionShape(size);  // and the Bullet rigid body  _rigidBox = new     OgreBulletDynamics::RigidBody("rigidBox", _world);  _rigidBox-&gt;setShape(_nodePerson, boxShape,     0 /* Restitucion */, 0 /* Friccion */,     30 /* Masa */, position /* Posicion inicial */,     rotation /* Orientacion */);  _rigidBox-&gt;setLinearVelocity(  _camera-&gt;getDerivedDirection().normalisedCopy() * 3.0);   _rigidBox-&gt;showDebugShape(true);  _rigidBox-&gt;setKinematicObject(true);  // Anadimos los objetos a las deques  _shapes.push_back(boxShape);   _bodies.push_back(_rigidBox);        }</code></pre></div><br>MOVE...<br><div class="codebox"><p>Code: </p><pre><code>       _rigidBox-&gt;enableActiveState();        _rigidBox-&gt;getBulletRigidBody()-&gt;setLinearVelocity(btVector3(0,0,1));        _rigidBox-&gt;getBulletRigidBody()-&gt;activate(true);        _rigidBox-&gt;getBulletRigidBody()-&gt;translate(btVector3(0,0,10));</code></pre></div><br>Wrapper: OgreBullet<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=12013">i7.strelok</a> — Sat Jun 03, 2017 4:30 pm</p><hr />
]]></content>
	</entry>
	</feed>
