<?xml version="1.0" encoding="UTF-8"?>
<system xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="description.xsd">
	
	<!--setting bone values for bones to prepare for physics -->
	<bone-default>
		<mass>0.1</mass>
		<inertia x="3" y="3" z="3" />
		<centerOfMassTransform>
			<basis x="0" y="0" z="0" w="1" />
			<origin x="0" y="0" z="0" />
		</centerOfMassTransform>
		<linearDamping>0.8</linearDamping>
		<angularDamping>0.8</angularDamping>
		<friction>0</friction>
		<rollingFriction>0</rollingFriction>
		<restitution>0</restitution>
		<gravity-factor>1</gravity-factor>
	</bone-default>

	<!--declaring physics bones 
	IMPORTANT! 
	Don't use names like "r01" "l03".
	For some reason really short bone names tend to not register properly by SMP. -->
	<bone name="SkirtT1"/>
	<bone name="SkirtT2"/>
	<bone name="SkirtT3"/>
	<bone name="SkirtFL1"/>
	<bone name="SkirtFL2"/>
	<bone name="SkirtFL3"/>
	<bone name="SkirtB1"/>
	<bone name="SkirtB2"/>
	<bone name="SkirtB3"/>
	<bone name="SkirtBR1"/>
	<bone name="SkirtBR2"/>
	<bone name="SkirtBR3"/>
	<bone name="SkirtR1"/>
	<bone name="SkirtR2"/>
	<bone name="SkirtL1"/>
	<bone name="SkirtL2"/>

	<!--changing bone mass to 0 so any other bones aren't under physics -->
	<bone-default>
	<mass>0</mass>
	</bone-default>
	
	<bone name="NPC Pelvis [Pelv]"/>
	<bone name="NPC L Thigh [LThg]"/>
	<bone name="NPC R Thigh [RThg]"/>
	<bone name="SkirtT0"/>	
	<bone name="SkirtFL0"/>		
	<bone name="SkirtB0"/>	
	<bone name="SkirtBR0"/>		
	<bone name="SkirtR0"/>
	<bone name="SkirtL0"/>	
	
	<!-- constraint settings for chaining bones -->
	<generic-constraint-default>
		<frameInA>
			<basis x="0" y="0" z="0" w="1" />
			<origin x="0" y="0" z="0" />
		</frameInA>
		<useLinearReferenceFrameA>false</useLinearReferenceFrameA>
		<linearLowerLimit x="0" y="0" z="0" />
		<linearUpperLimit x="0" y="0" z="0" />
		<angularLowerLimit x="-0.1" y="-0.1" z="-0.05" />
		<angularUpperLimit x="0.1" y="0.2" z="0.1" />
		<linearStiffness x="0" y="0" z="0" />
		<angularStiffness x="0" y="0" z="0" />
		<linearDamping x="0" y="0" z="0" />
		<angularDamping x="0" y="0" z="0" />
		<linearEquilibrium x="0" y="-1" z="-3" />
		<angularEquilibrium x="0" y="0" z="0" />
	</generic-constraint-default>
	
	<!--
	Chaining physics bones together. Notice physics bones being attached to non-physics bone. 
	-->
	<constraint-group>
		<generic-constraint bodyA="SkirtT0" bodyB="NPC Spine [Spn0]"/>
		<generic-constraint bodyA="SkirtT1" bodyB="SkirtT0"/>
		<generic-constraint bodyA="SkirtT2" bodyB="SkirtT1"/>
		<generic-constraint bodyA="SkirtT3" bodyB="SkirtT2"/>
		
		<generic-constraint bodyA="SkirtFL0" bodyB="NPC Spine [Spn0]"/>
		<generic-constraint bodyA="SkirtFL1" bodyB="SkirtFL0"/>
		<generic-constraint bodyA="SkirtFL2" bodyB="SkirtFL1"/>
		<generic-constraint bodyA="SkirtFL3" bodyB="SkirtFL2"/>
	
		<generic-constraint bodyA="SkirtB0" bodyB="NPC Spine [Spn0]"/>
		<generic-constraint bodyA="SkirtB1" bodyB="SkirtB0"/>
		<generic-constraint bodyA="SkirtB2" bodyB="SkirtB1"/>
		<generic-constraint bodyA="SkirtB3" bodyB="SkirtB2"/>
		
		<generic-constraint bodyA="SkirtBR0" bodyB="NPC Spine [Spn0]"/>
		<generic-constraint bodyA="SkirtBR1" bodyB="SkirtBR0"/>
		<generic-constraint bodyA="SkirtBR2" bodyB="SkirtBR1"/>
		<generic-constraint bodyA="SkirtBR3" bodyB="SkirtBR2"/>

		<generic-constraint bodyA="SkirtR0" bodyB="NPC Spine [Spn0]"/>
		<generic-constraint bodyA="SkirtR1" bodyB="SkirtR0"/>
		<generic-constraint bodyA="SkirtR2" bodyB="SkirtR1"/>
		
		<generic-constraint bodyA="SkirtL0" bodyB="NPC Spine [Spn0]"/>
		<generic-constraint bodyA="SkirtL1" bodyB="SkirtL0"/>
		<generic-constraint bodyA="SkirtL2" bodyB="SkirtL1"/>
	</constraint-group>
	
	<!--
	Name corresponds to nitrishape in the nif this xml is attached to 
	-->
	<per-triangle-shape name="DressTOP">
		<margin>0</margin>
		<penetration>0</penetration>
		<shared>public</shared>
		<tag>dress</tag>
		<no-collide-with-tag>dress</no-collide-with-tag>
		<can-collide-with-tag>FakeBody</can-collide-with-tag>
		<can-collide-with-tag>FakeGround</can-collide-with-tag>
		<can-collide-with-bone>NPC L Thigh [LThg]</can-collide-with-bone>
		<can-collide-with-bone>NPC R Thigh [RThg]</can-collide-with-bone>
	</per-triangle-shape>

	<per-triangle-shape name="VirtualGround">
		<margin>0.2</margin>
		<penetration>0</penetration>
		<shared>private</shared>
		<tag>FakeGround</tag>
		<can-collide-with-tag>dress</can-collide-with-tag>
	</per-triangle-shape>
	
	<per-triangle-shape name="VirtualBody">
		<margin>0.2</margin>
		<penetration>1</penetration>
		<shared>public</shared>
		<tag>FakeBody</tag>
		<can-collide-with-tag>dress</can-collide-with-tag>
	</per-triangle-shape>
	
</system>