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

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2014-04-02T16:05:39+00:00</updated>

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

		<entry>
		<author><name><![CDATA[Dragoon]]></name></author>
		<updated>2014-04-02T16:05:39+00:00</updated>

		<published>2014-04-02T16:05:39+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=33254#p33254</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=33254#p33254"/>
		<title type="html"><![CDATA[CollisionShape for mesh help (Irrlicht)]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=33254#p33254"><![CDATA[
Hi, I'm new to Bullet and Irrlicht, I'm trying to set the collision for a mesh I have loaded as a scene node. What is the best way to do this? I have some kind of collision at the moment but it's wrong obviously. The mesh itself is of a maze, it looks like this <br><img src="https://scontent-a-lhr.xx.fbcdn.net/hphotos-frc3/t1.0-9/p600x600/10177489_10152304024963485_2096544576_n.jpg" class="postimage" alt="Image"> <br><br>Heres my code that loads it, I just modified the Bullet/Irrlicht tutorial so it's probably wrong <div class="codebox"><p>Code: </p><pre><code>void createMaze(const btVector3&amp; position, const vector3df&amp; scale, float mass){IMesh* maze = game.getDevice()-&gt;getSceneManager()-&gt;getMesh("maze.obj");IMeshSceneNode* node = game.getDevice()-&gt;getSceneManager()-&gt;addMeshSceneNode(maze);node-&gt;setScale(irr::core::vector3df(0.2f, 0.2f, 0.2f));node-&gt;setMaterialFlag(EMF_LIGHTING, false);node-&gt;setMaterialTexture(0, game.getDevice()-&gt;getVideoDriver()-&gt;getTexture("cube.jpg"));btTransform transform;transform.setIdentity();transform.setOrigin(position);btDefaultMotionState* motionState = new btDefaultMotionState(transform);btVector3 halfExtents(scale.X * 0.5f, scale.Y * 0.5f, scale.Z * 0.5f);btCollisionShape* shape = new btBoxShape(halfExtents);btVector3 localInertia;shape-&gt;calculateLocalInertia(mass, localInertia);btRigidBody* rigidBody = new btRigidBody(mass, motionState, shape, localInertia);PhysicsEntity* physicsEntity = new PhysicsEntity(node);physicsEntity-&gt;setRigidBody(rigidBody);world-&gt;addRigidBody(rigidBody);}</code></pre></div><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=10820">Dragoon</a> — Wed Apr 02, 2014 4:05 pm</p><hr />
]]></content>
	</entry>
	</feed>
