mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-05 01:50:05 +00:00
commit
2e4e25b330
@ -66,7 +66,27 @@
|
||||
trigger = "enable_static_vr_plugin",
|
||||
description = "Statically link vr plugin (in examples/SharedMemory/plugins/vrSyncPlugin)"
|
||||
}
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "enable_static_test_plugin",
|
||||
description = "Statically link test plugin (in examples/SharedMemory/plugins/testPlugin)"
|
||||
}
|
||||
newoption
|
||||
{
|
||||
trigger = "enable_static_tiny_renderer__plugin",
|
||||
description = "Statically link vr plugin (in examples/SharedMemory/plugins/tinyRendererPlugin)"
|
||||
}
|
||||
newoption
|
||||
{
|
||||
trigger = "enable_static_pd_control_plugin",
|
||||
description = "Statically link vr plugin (in examples/SharedMemory/plugins/pdControlPlugin)"
|
||||
}
|
||||
newoption
|
||||
{
|
||||
trigger = "enable_static_collision_filter_plugin",
|
||||
description = "Statically link vr plugin (in examples/SharedMemory/plugins/collisionFilterPlugin)"
|
||||
}
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "enable_physx",
|
||||
@ -319,6 +339,12 @@ end
|
||||
trigger = "no-test",
|
||||
description = "Disable all tests"
|
||||
}
|
||||
newoption
|
||||
{
|
||||
trigger = "test-bullet2",
|
||||
|
||||
description = "Enable Bullet2 LinearMath test"
|
||||
}
|
||||
|
||||
newoption
|
||||
{
|
||||
@ -646,7 +672,9 @@ end
|
||||
end
|
||||
|
||||
if not _OPTIONS["no-test"] then
|
||||
if _OPTIONS["test-bullet2"] then
|
||||
include "../test/Bullet2"
|
||||
end
|
||||
|
||||
if not _OPTIONS["no-gtest"] then
|
||||
include "../test/gtest-1.7.0"
|
||||
|
@ -182,6 +182,7 @@ project "App_BulletExampleBrowser"
|
||||
"../VoronoiFracture/*",
|
||||
"../SoftDemo/*",
|
||||
"../DeformableDemo/*",
|
||||
"../ReducedDeformableDemo/*",
|
||||
"../RollingFrictionDemo/*",
|
||||
"../rbdl/*",
|
||||
"../FractureDemo/*",
|
||||
|
@ -123,7 +123,7 @@ if (_OPTIONS["enable_static_vr_plugin"]) then
|
||||
files {"plugins/vrSyncPlugin/vrSyncPlugin.cpp"}
|
||||
end
|
||||
|
||||
if (not _OPTIONS["disable_static_tinyrenderer_plugin"]) then
|
||||
if (_OPTIONS["enable_static_tinyrenderer_plugin"]) then
|
||||
files
|
||||
{
|
||||
"plugins/tinyRendererPlugin/tinyRendererPlugin.cpp",
|
||||
@ -222,7 +222,7 @@ language "C++"
|
||||
|
||||
end
|
||||
|
||||
if (not _OPTIONS["disable_static_tinyrenderer_plugin"]) then
|
||||
if ( _OPTIONS["enable_static_tinyrenderer_plugin"]) then
|
||||
files
|
||||
{
|
||||
"plugins/tinyRendererPlugin/tinyRendererPlugin.cpp",
|
||||
@ -381,7 +381,7 @@ if os.is("Windows") then
|
||||
initOpenGL()
|
||||
initGlew()
|
||||
|
||||
if (not _OPTIONS["disable_static_tinyrenderer_plugin"]) then
|
||||
if ( _OPTIONS["enable_static_tinyrenderer_plugin"]) then
|
||||
files
|
||||
{
|
||||
"plugins/tinyRendererPlugin/tinyRendererPlugin.cpp",
|
||||
@ -477,13 +477,24 @@ end
|
||||
include "udp"
|
||||
include "tcp"
|
||||
|
||||
if (_OPTIONS["enable_static_test_plugin"]) then
|
||||
include "plugins/testPlugin"
|
||||
end
|
||||
|
||||
if (_OPTIONS["enable_vr_sync_plugin"]) then
|
||||
include "plugins/vrSyncPlugin"
|
||||
end
|
||||
|
||||
if (_OPTIONS["enable_static_tiny_renderer__plugin"]) then
|
||||
include "plugins/tinyRendererPlugin"
|
||||
|
||||
end
|
||||
if (_OPTIONS["enable_static_pd_control_plugin"]) then
|
||||
include "plugins/pdControlPlugin"
|
||||
include "plugins/collisionFilterPlugin"
|
||||
end
|
||||
|
||||
if (_OPTIONS["enable_static_collision_filter_plugin"]) then
|
||||
include "plugins/collisionFilterPlugin"
|
||||
end
|
||||
if _OPTIONS["enable_egl"] then
|
||||
include "plugins/eglPlugin"
|
||||
end
|
||||
|
4
setup.py
4
setup.py
@ -257,6 +257,10 @@ sources = ["examples/pybullet/pybullet.c"]\
|
||||
+["src/BulletSoftBody/btDeformableMultiBodyConstraintSolver.cpp"]\
|
||||
+["src/BulletSoftBody/btDeformableMultiBodyDynamicsWorld.cpp"]\
|
||||
+["src/BulletSoftBody/poly34.cpp"]\
|
||||
+["src/BulletSoftBody/BulletReducedDeformableBody/btReducedDeformableBody.cpp"]\
|
||||
+["src/BulletSoftBody/BulletReducedDeformableBody/btReducedDeformableBodyHelpers.cpp"]\
|
||||
+["src/BulletSoftBody/BulletReducedDeformableBody/btReducedDeformableBodySolver.cpp"]\
|
||||
+["src/BulletSoftBody/BulletReducedDeformableBody/btReducedDeformableContactConstraint.cpp"]\
|
||||
+["src/BulletInverseDynamics/IDMath.cpp"]\
|
||||
+["src/BulletInverseDynamics/MultiBodyTree.cpp"]\
|
||||
+["src/BulletInverseDynamics/details/MultiBodyTreeImpl.cpp"]\
|
||||
|
@ -103,6 +103,44 @@ void btConvexTriangleCallback::processTriangle(btVector3* triangle, int partId,
|
||||
|
||||
if (m_convexBodyWrap->getCollisionShape()->isConvex())
|
||||
{
|
||||
#ifndef BT_DISABLE_CONVEX_CONCAVE_EARLY_OUT
|
||||
//an early out optimisation if the object is separated from the triangle
|
||||
//projected on the triangle normal)
|
||||
{
|
||||
const btVector3 v0 = m_triBodyWrap->getWorldTransform()*triangle[0];
|
||||
const btVector3 v1 = m_triBodyWrap->getWorldTransform()*triangle[1];
|
||||
const btVector3 v2 = m_triBodyWrap->getWorldTransform()*triangle[2];
|
||||
|
||||
btVector3 triangle_normal_world = ( v1 - v0).cross(v2 - v0);
|
||||
triangle_normal_world.normalize();
|
||||
|
||||
btConvexShape* convex = (btConvexShape*)m_convexBodyWrap->getCollisionShape();
|
||||
|
||||
btVector3 localPt = convex->localGetSupportingVertex(m_convexBodyWrap->getWorldTransform().getBasis().inverse()*triangle_normal_world);
|
||||
btVector3 worldPt = m_convexBodyWrap->getWorldTransform()*localPt;
|
||||
//now check if this is fully on one side of the triangle
|
||||
btScalar proj_distPt = triangle_normal_world.dot(worldPt);
|
||||
btScalar proj_distTr = triangle_normal_world.dot(v0);
|
||||
btScalar contact_threshold = m_manifoldPtr->getContactBreakingThreshold()+ m_resultOut->m_closestPointDistanceThreshold;
|
||||
btScalar dist = proj_distTr - proj_distPt;
|
||||
if (dist > contact_threshold)
|
||||
return;
|
||||
|
||||
//also check the other side of the triangle
|
||||
triangle_normal_world*=-1;
|
||||
|
||||
localPt = convex->localGetSupportingVertex(m_convexBodyWrap->getWorldTransform().getBasis().inverse()*triangle_normal_world);
|
||||
worldPt = m_convexBodyWrap->getWorldTransform()*localPt;
|
||||
//now check if this is fully on one side of the triangle
|
||||
proj_distPt = triangle_normal_world.dot(worldPt);
|
||||
proj_distTr = triangle_normal_world.dot(v0);
|
||||
|
||||
dist = proj_distTr - proj_distPt;
|
||||
if (dist > contact_threshold)
|
||||
return;
|
||||
}
|
||||
#endif //BT_DISABLE_CONVEX_CONCAVE_EARLY_OUT
|
||||
|
||||
btTriangleShape tm(triangle[0], triangle[1], triangle[2]);
|
||||
tm.setMargin(m_collisionMarginTriangle);
|
||||
|
||||
@ -132,7 +170,10 @@ void btConvexTriangleCallback::processTriangle(btVector3* triangle, int partId,
|
||||
m_resultOut->setShapeIdentifiersB(partId, triangleIndex);
|
||||
}
|
||||
|
||||
colAlgo->processCollision(m_convexBodyWrap, &triObWrap, *m_dispatchInfoPtr, m_resultOut);
|
||||
{
|
||||
BT_PROFILE("processCollision (GJK?)");
|
||||
colAlgo->processCollision(m_convexBodyWrap, &triObWrap, *m_dispatchInfoPtr, m_resultOut);
|
||||
}
|
||||
|
||||
if (m_resultOut->getBody0Internal() == m_triBodyWrap->getCollisionObject())
|
||||
{
|
||||
|
@ -10,5 +10,6 @@
|
||||
end
|
||||
files {
|
||||
"**.cpp",
|
||||
"BulletReducedDeformableBody/**.cpp",
|
||||
"**.h"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user