<Node name="root" dt="0.005" showBehaviorModels="0" showCollisionModels="0" showMappings="0" showForceFields="0" >

	<Node name="Tooth" >
		<Node name="VisualModel" >
			<Object type="OglModel" name="ToothVisualModel" fileMesh="data/mesh/tooth_closed.obj" color="white" /> 
		</Node>
		<Node name="CollisionModel" >
		 	<Object type="MeshLoader" filename="data/mesh/tooth_closed.obj" />
			<Object type="Mesh" name="ToothCollisionModel" />
			<Object type="MechanicalObject" name="toothState" />		
			<Object type="Triangle" name="tooth" contactStiffness="100" simulated="0" moving="0"/>
			<Object type="Line" name="tooth" contactStiffness="100" simulated="0" moving="0"/>	
			<Object type="Point" name="tooth" contactStiffness="100" simulated="0" moving="0"/>	
		</Node>
	</Node>
	
	<!-- ADDED: the Mechanical state Controller gathers events from the Omni driver and populates the Mechanical state -->
	<Node name="Omni">
		<Object type="MechanicalObject" template="Rigid" name="DOFs" position="1.2 1.6 -3.55  0 0 0 1"/>
		<Object type="MechanicalStateController" template="Rigid" listening="true" mainDirection="-1.0 0.0 0.0" handleEventTriggersUpdate="true"/>
		<Node name="RefModel">
			<Object type="MeshLoader" filename="data/mesh/dental_instrument_centerline.obj" />
			<Object type="Mesh" />
			<Object type="MechanicalObject" name="instrumentCollisionState" rx="180" rz="150" dx="-1.2" dy="-1.6" dz="3.55"/>
			<Object type="RigidMapping" />
		</Node>
	</Node>
	
	<Node name="Instrument" >
		<Object type="EulerImplicitSolver" name="ODE solver" rayleighStiffness="0.01" rayleighMass="1.0" />
		<Object type="CGLinearSolver" name="linear solver" iterations="25" tolerance="1e-10" threshold="10e-10" /> 
		<Object type="MechanicalObject" name="instrumentState" template="Rigid" position="1.2 1.6 -3.55  0 0 0 1"/>
		<Object type="UniformMass" name="mass" totalmass="0.05" filename="BehaviorModels/dental_instrument.rigid" />
		<Object type="LCPForceFeedback" activate="true" forceCoef="0.005"/> <!-- ADDED : Compute a force-feedback for the device -->
		<Object type="UncoupledConstraintCorrection"/>
		<Node name="VisualModel" >
			<Object type="OglModel" name="InstrumentVisualModel" fileMesh="data/mesh/dental_instrument.obj" color="1.0 0.2 0.2 1.0" rx="180" rz="150" dx="-1.2" dy="-1.6" dz="3.55"/>
			<Object type="RigidMapping" name="MM->VM mapping" object1="instrumentState" object2="InstrumentVisualModel" />
		</Node>
		<Node name="CollisionModel" >
			<Object type="MeshLoader" filename="data/mesh/dental_instrument_centerline.obj" />
			<Object type="Mesh" name="InstrumentCollisionModel" />
			<Object type="MechanicalObject" name="instrumentCollisionState" rx="180" rz="150" dx="-1.2" dy="-1.6" dz="3.55"/>
			<Object type="Triangle" name="instrument" contactStiffness="10" />
			<Object type="Line" name="instrument" contactStiffness="10" />
			<Object type="Point" name="instrument" contactStiffness="10" /> 
			<Object type="RigidMapping" name="MM->CM mapping" object1="instrumentState" object2="instrumentCollisionState" />
		</Node>
		<Object type="VectorSpringForceField"  object1="Omni/RefModel/instrumentCollisionState" object2="Instrument/CollisionModel/instrumentCollisionState" stiffness="10" viscosity="0" />
		<Object type="JointSpringForceField" template="Rigid" name="joint springs" object1="Omni" object2="instrumentState" 
			spring="BEGIN_SPRING 0 0 KS_T 50 50  KS_R 500.0 500.0  KS_B 500.0  KD 0.0 END_SPRING"  />
	</Node>
</Node>
