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

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2021-04-25T18:26:07+00:00</updated>

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

		<entry>
		<author><name><![CDATA[dorcsyful]]></name></author>
		<updated>2021-04-25T18:26:07+00:00</updated>

		<published>2021-04-25T18:26:07+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43409#p43409</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43409#p43409"/>
		<title type="html"><![CDATA[Raycast vehicle not working]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43409#p43409"><![CDATA[
So I've been working on a project that involves implementing Bullet into Unreal Engine. So far it's been pretty successful: conversions and general movements are working perfectly. However I did run into an issue with the Raycast Vehicle: I followed the example that's on Github as best as I could (the calculations of the connection point were completely wrong and putting the suspension above 0.2 seems to push the wheels downwards by a lot), but it seems to partially sink into the ground. I say partially because the sinking stops at the connection point of the wheels to the chassis<div class="codebox"><p>Code: </p><pre><code>m_Raycaster = new btDefaultVehicleRaycaster(m_World);    m_RVehicle = new btRaycastVehicle(m_Tuning,m_Chassis,m_Raycaster);    m_Chassis-&gt;setActivationState(DISABLE_DEACTIVATION);    AddAllWheels(a_Wheel, a_Transforms);     m_World-&gt;addVehicle(m_RVehicle);    btVector3 wheelDirectionCS0(0, 0,-1);    //The axis which the wheel rotates arround    btVector3 wheelAxleCS(0,1,0);    btScalar wheelWidth = a_Wheel-&gt;getHalfHeight() * 2.f;    btScalar wheelRadius = a_Wheel-&gt;getRadius();    btVector3 trans = a_Transforms["FL"].getOrigin();    btScalar suspensionRestLength = 0.2;    btVector3 wheelConnectionPoint(trans.getY() + wheelRadius,trans.getZ() + wheelWidth,wheelRadius *2.f);    //Adding front wheels    m_RVehicle-&gt;addWheel(wheelConnectionPoint, wheelDirectionCS0, wheelAxleCS, suspensionRestLength,a_Wheel-&gt;getRadius(), m_Tuning, true);        m_RVehicle-&gt;addWheel(wheelConnectionPoint * btVector3(1, -1, 1), wheelDirectionCS0, wheelAxleCS, suspensionRestLength, a_Wheel-&gt;getRadius(), m_Tuning, true);    //Adds the rear wheels    m_RVehicle-&gt;addWheel(wheelConnectionPoint * btVector3(-1, 1, 1), wheelDirectionCS0, wheelAxleCS, suspensionRestLength, a_Wheel-&gt;getRadius(), m_Tuning, false);    // //    m_RVehicle-&gt;addWheel(wheelConnectionPoint * btVector3(-1, -1, 1), wheelDirectionCS0, wheelAxleCS, suspensionRestLength, a_Wheel-&gt;getRadius(), m_Tuning, false);    //</code></pre></div>I'm not sure if this is related to me working with Unreal or if it's only on the Bullet side, but thanks in advance <img class="smilies" src="https://pybullet.org/Bullet/phpBB3/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=13961">dorcsyful</a> — Sun Apr 25, 2021 6:26 pm</p><hr />
]]></content>
	</entry>
	</feed>
