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

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2021-04-17T11:23:30+00:00</updated>

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

		<entry>
		<author><name><![CDATA[paokakis]]></name></author>
		<updated>2021-04-17T11:23:30+00:00</updated>

		<published>2021-04-17T11:23:30+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43404#p43404</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43404#p43404"/>
		<title type="html"><![CDATA[Re: RayTest btConvexHullShape fails]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43404#p43404"><![CDATA[
It was my problem. My object had multiple meshes so multiple convex hulls were added. After debug drawing I could see the convex hulls and were able to ray test them. So it is solved<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=13868">paokakis</a> — Sat Apr 17, 2021 11:23 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[paokakis]]></name></author>
		<updated>2021-04-17T09:19:46+00:00</updated>

		<published>2021-04-17T09:19:46+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43403#p43403</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43403#p43403"/>
		<title type="html"><![CDATA[RayTest btConvexHullShape fails]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43403#p43403"><![CDATA[
I am developing a 3D space shooter game using bullet physics. I have a crosshair in the middle of the screen and I am ray testing from the center of the screen to the camera far vector in bullet to get the first collision object in that ray. If the object is a sphere or a box the test is very accurate and successful. If the object is a convex hull shape then the ray test fails 90%... Here is my code :<br><div class="codebox"><p>Code: </p><pre><code>bool BphysicsManager::rayHasHit(glm::vec3&amp; rayFromWorld, glm::vec3&amp; rayToWorld, btVector3* hitPointWorld, btRigidBody** body){mMutex-&gt;lock();bool ret;rayFrom.setX(rayFromWorld.x);rayFrom.setY(rayFromWorld.y);rayFrom.setZ(rayFromWorld.z);rayTo.setX(rayToWorld.x);rayTo.setY(rayToWorld.y);rayTo.setZ(rayToWorld.z);btCollisionWorld::ClosestRayResultCallback rayCallback(rayFrom, rayTo);mpDynamicsWorld-&gt;rayTest(rayFrom, rayTo, rayCallback);if (rayCallback.m_collisionObject){*body = (btRigidBody*)btRigidBody::upcast(rayCallback.m_collisionObject);*hitPointWorld = rayCallback.m_hitPointWorld;auto colShape = (*body)-&gt;getCollisionShape();if (dynamic_cast&lt;btConcaveShape*&gt;(colShape) != nullptr){*body = nullptr;}}ret = rayCallback.hasHit();mMutex-&gt;unlock();return ret;}</code></pre></div>Am I doing something wrong with the convex hull shape or is it a bullet problem? Can I do something to improve it?<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=13868">paokakis</a> — Sat Apr 17, 2021 9:19 am</p><hr />
]]></content>
	</entry>
	</feed>
