<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" >

	<xs:element name="TrackingActionMapping">
		<xs:complexType>
			<xs:choice minOccurs="0" maxOccurs="unbounded">
				<xs:element name="MovieAction" type="MovieAction" />
				<xs:element name="GeometryAction" type="GeometryAction" />
				<xs:element name="UBIKObjectAction" type="UBIKObjectAction" />
			</xs:choice>
		</xs:complexType>
		<xs:unique name="TrackingActionUniqueness" >
			<xs:selector xpath="TrackingAction"/> 
			<xs:field xpath="@TrackingID"/>
		</xs:unique>
	</xs:element>

	<xs:complexType name="Vector3D">
		<xs:sequence>
			<xs:element name="X" type="xs:float" minOccurs="0" />
			<xs:element name="Y" type="xs:float" minOccurs="0" />
			<xs:element name="Z" type="xs:float" minOccurs="0" />
		</xs:sequence>
	</xs:complexType>
	
	<xs:complexType name="ARResource">
			<xs:sequence>
				<xs:element name="ResourcePath" type="xs:string" />
				<xs:element name="Scale" type="xs:float" minOccurs="0" />
				<xs:element name="OffsetMillimeters" type="Vector3D" minOccurs="0" />
			</xs:sequence>
	</xs:complexType>
	
	<xs:complexType name="ARGeometry">
		<xs:complexContent>
			<xs:extension base="ARResource">
				<xs:sequence>
					<xs:element name="RotationDegrees" type="Vector3D" minOccurs="0" />
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>

	<xs:complexType name="TrackingAction">
			<xs:attribute name="TrackingID" type="xs:integer"/>
	</xs:complexType>

	<xs:complexType name="MovieAction">
		<xs:complexContent>
			<xs:extension base="TrackingAction">
				<xs:sequence> 
					<xs:element name="MovieResource" type="ARResource" />
					<xs:element name="PlayButton" type="ARGeometry" minOccurs="0" />
				</xs:sequence>
			</xs:extension>
</xs:complexContent>
	</xs:complexType>

	<xs:complexType name="GeometryAction"> 
		<xs:complexContent>
			<xs:extension base="TrackingAction">
				<xs:sequence> 
					<xs:element name="GeometryResource" type="ARGeometry" minOccurs="0" />
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>

	<xs:complexType name="UBIKObjectAction">
		<xs:complexContent>
			<xs:extension base="TrackingAction">
				<xs:sequence> 
					<xs:element name="UBIK-UID" type="xs:string" minOccurs="0" />
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>

</xs:schema>
