mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-13 13:20:07 +00:00
add example for enableSAT, using separating axis test (instead of GJK) for contact between polyhedral convex hull shapes (and convex hull vs triangle in a concave triangle mesh)
This commit is contained in:
parent
97c6937388
commit
459d07a302
32
data/cube_concave.urdf
Normal file
32
data/cube_concave.urdf
Normal file
@ -0,0 +1,32 @@
|
||||
<?xml version="0.0" ?>
|
||||
<robot name="cube">
|
||||
<link name="baseLink">
|
||||
<contact>
|
||||
<lateral_friction value="1.0"/>
|
||||
<rolling_friction value="0.0"/>
|
||||
<contact_cfm value="0.0"/>
|
||||
<contact_erp value="1.0"/>
|
||||
</contact>
|
||||
<inertial>
|
||||
<origin rpy="0 0 0" xyz="0 0 0"/>
|
||||
<mass value="1.0"/>
|
||||
<inertia ixx="1" ixy="0" ixz="0" iyy="1" iyz="0" izz="1"/>
|
||||
</inertial>
|
||||
<visual>
|
||||
<origin rpy="0 0 0" xyz="0 0 0"/>
|
||||
<geometry>
|
||||
<mesh filename="cube.obj" scale="1 1 1"/>
|
||||
</geometry>
|
||||
<material name="white">
|
||||
<color rgba="1 1 1 1"/>
|
||||
</material>
|
||||
</visual>
|
||||
<collision concave="yes">
|
||||
<origin rpy="0 0 0" xyz="0 0 0"/>
|
||||
<geometry>
|
||||
<mesh filename="cube.obj" scale="1 1 1"/>
|
||||
</geometry>
|
||||
</collision>
|
||||
</link>
|
||||
</robot>
|
||||
|
14
examples/pybullet/examples/satCollision.py
Normal file
14
examples/pybullet/examples/satCollision.py
Normal file
@ -0,0 +1,14 @@
|
||||
import pybullet as p
|
||||
import time
|
||||
|
||||
p.connect(p.GUI)
|
||||
p.setGravity(0,0,-10)
|
||||
p.setPhysicsEngineParameter(enableSAT=1)
|
||||
p.loadURDF("cube_concave.urdf",[0,0,-25], globalScaling=50, useFixedBase=True)
|
||||
p.loadURDF("cube.urdf",[0,0,1], globalScaling=1)
|
||||
p.loadURDF("duck_vhacd.urdf",[1,0,1], globalScaling=1)
|
||||
|
||||
while (p.isConnected()):
|
||||
p.stepSimulation()
|
||||
time.sleep(1./240.)
|
||||
|
Loading…
Reference in New Issue
Block a user