/
TransformEngine.scn
55 lines (54 loc) · 4.56 KB
/
TransformEngine.scn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<Node name="Root" gravity="0 0 0" dt="0.02">
<RequiredPlugin name="Sofa.Component.Collision.Detection.Algorithm"/> <!-- Needed to use components [BVHNarrowPhase BruteForceBroadPhase CollisionPipeline] -->
<RequiredPlugin name="Sofa.Component.Collision.Detection.Intersection"/> <!-- Needed to use components [MinProximityIntersection] -->
<RequiredPlugin name="Sofa.Component.Collision.Geometry"/> <!-- Needed to use components [LineCollisionModel PointCollisionModel TriangleCollisionModel] -->
<RequiredPlugin name="Sofa.Component.Collision.Response.Contact"/> <!-- Needed to use components [CollisionResponse] -->
<RequiredPlugin name="Sofa.Component.Engine.Transform"/> <!-- Needed to use components [TransformEngine] -->
<RequiredPlugin name="Sofa.Component.IO.Mesh"/> <!-- Needed to use components [MeshOBJLoader] -->
<RequiredPlugin name="Sofa.Component.LinearSolver.Iterative"/> <!-- Needed to use components [CGLinearSolver] -->
<RequiredPlugin name="Sofa.Component.Mapping.Linear"/> <!-- Needed to use components [BarycentricMapping] -->
<RequiredPlugin name="Sofa.Component.Mass"/> <!-- Needed to use components [UniformMass] -->
<RequiredPlugin name="Sofa.Component.ODESolver.Backward"/> <!-- Needed to use components [EulerImplicitSolver] -->
<RequiredPlugin name="Sofa.Component.SolidMechanics.FEM.Elastic"/> <!-- Needed to use components [HexahedronFEMForceField] -->
<RequiredPlugin name="Sofa.Component.StateContainer"/> <!-- Needed to use components [MechanicalObject] -->
<RequiredPlugin name="Sofa.Component.Topology.Container.Constant"/> <!-- Needed to use components [MeshTopology] -->
<RequiredPlugin name="Sofa.Component.Topology.Container.Grid"/> <!-- Needed to use components [SparseGridTopology] -->
<RequiredPlugin name="Sofa.Component.Visual"/> <!-- Needed to use components [VisualStyle] -->
<RequiredPlugin name="Sofa.GL.Component.Rendering3D"/> <!-- Needed to use components [OglModel] -->
<DefaultAnimationLoop/>
<VisualStyle displayFlags="showVisual" />
<CollisionPipeline name="DefaultCollisionPipeline" verbose="0" draw="0" depth="6" />
<BruteForceBroadPhase/>
<BVHNarrowPhase/>
<MinProximityIntersection name="Proximity" alarmDistance="0.3" contactDistance="0.2" />
<CollisionResponse name="Response" response="PenalityContactForceField" />
<!-- Using the Transform Engine on the independent MechanicalState -->
<Node name="TransformedState" gravity="0 -9.81 0">
<EulerImplicitSolver name="default12" rayleighStiffness="0.01" rayleighMass="0.1" />
<CGLinearSolver template="GraphScattered" name="default13" iterations="25" threshold="1e-08" tolerance="1e-05"/>
<SparseGridTopology name="default14" fileTopology="mesh/doubleBall.obj" n="6 6 6" />
<TransformEngine name="transform" template="Vec3" translation="10 0 0" rotation="0 0 90" scale="0.5 1 2" input_position="@[-1].position" />
<MechanicalObject template="Vec3" name="dofTransformed" position="@[-1].output_position" restScale="1" />
<UniformMass name="default16" totalMass="5" />
<HexahedronFEMForceField template="Vec3" name="FEM" method="polar" poissonRatio="0.3" youngModulus="5000" />
<Node name="VisualNode" gravity="0 -9.81 0">
<MeshOBJLoader name="meshLoader_0" filename="mesh/doubleBall.obj" handleSeams="1" />
<OglModel template="Vec3" name="Visual" src="@meshLoader_0" texturename="textures/board.png" material="Default Diffuse 1 1 0 0 1 Ambient 1 0.2 0 0 1 Specular 0 1 0 0 1 Emissive 0 1 0 0 1 Shininess 0 45" />
<BarycentricMapping template="Vec3,Vec3" name="default17" input="@.." output="@Visual" />
</Node>
<Node name="CollisionNode" gravity="0 -9.81 0">
<MeshOBJLoader name="loader" filename="mesh/doubleBall.obj" />
<MeshTopology src="@loader" name="default18" />
<MechanicalObject src="@loader" template="Vec3" name="default19" restScale="1" />
<TriangleCollisionModel name="default20" />
<LineCollisionModel name="default21" />
<PointCollisionModel name="default22" />
<BarycentricMapping template="Vec3,Vec3" name="default23" />
</Node>
</Node>
<Node name="VisualModel">
<MeshOBJLoader name="ObjLoader" filename="mesh/floor3.obj" />
<TransformEngine name="transform" template="Vec3" translation="5 0 0" rotation="0 0 -90" scale="0.1 0.3 0.1" input_position="@[-1].position" />
<OglModel name="VisualModel" src="@./ObjLoader" position="@[-1].output_position" texturename="textures/floor.bmp" />
</Node>
</Node>