TutorialCollisionCubes
From SOFAWiki
Tutorial : Collision Cubes
- Previous Tutorial: TutorialCollisionCubeObstacle
- Next Tutorial: TutorialCollisionMultipleGroups
Example Scene making the interactions between two deformable cubes using different collision models
This example is distributed inexamples/Tutorials/Basic/TutorialCollisionCubes.scnwithin SofaSVN and SOFA distributions starting from 1.0 beta 4.
Graph
XML Description
<?xml version="1.0" ?> <!-- See http://wiki.sofa-framework.org/mediawiki/index.php/TutorialCollisionCubeObstacle.scn --> <Node name="root" dt="0.01" gravity="0 -9.81 0" showBehavior="1" showCollision="1"> <!-- Basic Components to perform the collision detection --> <CollisionPipeline/> <BruteForceDetection/> <DefaultContactManager/> <MinProximityIntersection/> <!-- Using a deformable cube using collision spheres --> <Node name="Cube1"> <EulerImplicitSolver name="EulerImplicit Cube1" /> <CGLinearSolver name="CG Solver Cube1" /> <MechanicalObject name="Particles Cube1" template="Vec3d" position="0 0 1 1 0 1 0 1 1 1 1 1 0 0 2 1 0 2 0 1 2 1 1 2" translation="0.5 2 0"/> <MeshTopology name="Topology Cube1" hexas="0 4 6 2 1 5 7 3" /> <UniformMass name="Mass Cube1" totalmass="1" /> <MeshSpringForceField name="Springs Cube1" stiffness="100" damping="1" /> <!-- Collision Models --> <SphereModel name="Spheres For Collision Cube1" radius="0.2"/> </Node> <!-- Using a deformable cube using collision triangles, lines and points --> <Node name="Cube2"> <EulerImplicitSolver name="EulerImplicit Cube2" /> <CGLinearSolver name="CG Solver Cube2" /> <MechanicalObject name="Particles Cube2" template="Vec3d" position="0 0 1 1 0 1 0 1 1 1 1 1 0 0 2 1 0 2 0 1 2 1 1 2" /> <MeshTopology name="Topology Cube2" hexas="0 4 6 2 1 5 7 3" /> <UniformMass name="Mass Cube2" totalmass="1" /> <MeshSpringForceField name="Springs Cube2" stiffness="15" damping="1" /> <!-- Collision Models --> <TriangleModel name="Triangles For Collision"/> <LineModel name="Lines For Collision"/> <PointModel name="Points For Collision"/> </Node> <Node name="Floor"> <MeshTopology name="Topology Floor" filename="mesh/floor.obj"/> <MechanicalObject name="Particles Floor"/> <TriangleModel name="Triangle For Collision Floor" moving="0" simulated="0"/> </Node> </Node>
