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

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2019-09-24T16:24:53+00:00</updated>

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

		<entry>
		<author><name><![CDATA[uknown_user123]]></name></author>
		<updated>2019-09-24T16:24:53+00:00</updated>

		<published>2019-09-24T16:24:53+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42401#p42401</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42401#p42401"/>
		<title type="html"><![CDATA[SoftBody is slipping through RigidBody.]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42401#p42401"><![CDATA[
Hey guys,<br>I've recently started doing stuff with bullet and can't figure out something.<br><br>I have got a simple soft body (a square patch) and a mesh that I load myself with tiny_obj_loader. I throw the patch on the mesh and expect it to get stuck on top of it.<br><br>Here's what I get: <a href="https://www.youtube.com/watch?v=VSS-G48PExM&amp;feature=youtu.be" class="postlink">https://www.youtube.com/watch?v=VSS-G48 ... e=youtu.be</a><br><br>I can see that there's some kind of collision, since the patch is being pulled up a bit in the center when it goes through the mesh.<br>When I use the box primitive instead of a mesh, everything works fine.<br><br>So, here's the question:<br>How do I create a mesh properly and what am I doing wrong?<br><div class="codebox"><p>Code: </p><pre><code>    btTriangleMesh* triangleMeshTerrain = new btTriangleMesh();    // here I parse the .obj file and add triangles via 'triangleMeshTerrain-&gt;addTriangle(vertex1, vertex2, vertex3);'    btCollisionShape* collisionShapeTerrain = new btBvhTriangleMeshShape(triangleMeshTerrain, true);    btTransform meshTransform;    meshTransform.setIdentity();    meshTransform.setOrigin(btVector3(0.0, 0.0, 0.0));    btDefaultMotionState* motionState = new btDefaultMotionState(meshTransform);    btRigidBody::btRigidBodyConstructionInfo rigidBodyConstructionInfo(0.0f, motionState, collisionShapeTerrain, btVector3(0.0, 0.0, 0.0));    btRigidBody* rigidBodyTerrain = new btRigidBody(rigidBodyConstructionInfo);    rigidBodyTerrain-&gt;setFriction(btScalar(0.9));    getDynamicsWorld()-&gt;addRigidBody(rigidBodyTerrain);</code></pre></div>I believe the mesh is alright and I parse it correctly, since it's rendered okay.<br><br><br>Thanks,<br>Denis<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=13424">uknown_user123</a> — Tue Sep 24, 2019 4:24 pm</p><hr />
]]></content>
	</entry>
	</feed>
